diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml
index 20e39ac7..e39d45d7 100644
--- a/.github/workflows/Tests.yml
+++ b/.github/workflows/Tests.yml
@@ -3,17 +3,18 @@ name: Tests
on:
push:
pull_request:
- types: [opened]
+ types: [opened, synchronize, reopened]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
jobs:
Tests:
- runs-on: macos-13
+ runs-on: macos-14-xlarge
steps:
- - name: Cancel previous jobs
- uses: styfle/cancel-workflow-action@0.11.0
-
- name: Checkout Repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Load Latest Xcode
uses: maxim-lobanov/setup-xcode@v1
@@ -21,8 +22,8 @@ jobs:
xcode-version: latest-stable
- name: Build project
- run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild build-for-testing -destination 'name=iPhone 14 Pro' -scheme 'PovioKit-Package' | xcpretty
+ run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild build-for-testing -destination 'name=iPhone 14 Pro' -scheme 'PovioKit-Package' | xcbeautify --renderer github-actions
- name: Run tests
- run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild test-without-building -destination 'name=iPhone 14 Pro' -scheme 'PovioKit-Package' | xcpretty
+ run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild test-without-building -destination 'name=iPhone 14 Pro' -scheme 'PovioKit-Package' | xcbeautify --renderer github-actions
diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/PovioKit-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/PovioKit-Package.xcscheme
index 00992b39..8976f8f0 100644
--- a/.swiftpm/xcode/xcshareddata/xcschemes/PovioKit-Package.xcscheme
+++ b/.swiftpm/xcode/xcshareddata/xcschemes/PovioKit-Package.xcscheme
@@ -146,6 +146,20 @@
ReferencedContainer = "container:">
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright (c) 2024 Povio Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/MIGRATING.md b/MIGRATING.md
index 46c1d231..6e19cd65 100644
--- a/MIGRATING.md
+++ b/MIGRATING.md
@@ -1,5 +1,9 @@
## Migration Guides
+### Migration from versions < 4.0.0
+* [Core] If you have used any utilities referencing to PovioKitCore package, you'll need to replace it. They've been moved to PovioKitUtilities.
+* [UI] PovioKitUI package has been replaced by PovioKitUIKit and/or PovioKitSwiftUI. Replace depending on the type of UI code you were depending on.
+
### Migration from versions < 3.0.0
* [Auth] All Auth products are removed from the PovioKit package and effectivelly moved to a standalone repo https://github.com/poviolabs/PovioKitAuth. In order to continue using Auth products, install the new package `PovioKitAuth` package from the given repo url.
diff --git a/Package.resolved b/Package.resolved
index 4eaee067..dffa1041 100644
--- a/Package.resolved
+++ b/Package.resolved
@@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
- "revision" : "3dc6a42c7727c49bf26508e29b0a0b35f9c7e1ad",
- "version" : "5.8.1"
+ "revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a",
+ "version" : "5.9.1"
}
}
],
diff --git a/Package.swift b/Package.swift
index bf5c3182..21b13cf5 100644
--- a/Package.swift
+++ b/Package.swift
@@ -4,17 +4,43 @@ import PackageDescription
let package = Package(
name: "PovioKit",
platforms: [
- .iOS(.v13)
+ .iOS(.v13), .macOS(.v13)
],
products: [
- .library(name: "PovioKitCore", targets: ["PovioKitCore"]),
- .library(name: "PovioKitNetworking", targets: ["PovioKitNetworking"]),
- .library(name: "PovioKitPromise", targets: ["PovioKitPromise"]),
- .library(name: "PovioKitUI", targets: ["PovioKitUI"]),
- .library(name: "PovioKitAsync", targets: ["PovioKitAsync"]),
+ .library(
+ name: "PovioKitCore",
+ targets: ["PovioKitCore"]
+ ),
+ .library(
+ name: "PovioKitUtilities",
+ targets: ["PovioKitUtilities"]
+ ),
+ .library(
+ name: "PovioKitNetworking",
+ targets: ["PovioKitNetworking"]
+ ),
+ .library(
+ name: "PovioKitPromise",
+ targets: ["PovioKitPromise"]
+ ),
+ .library(
+ name: "PovioKitUIKit",
+ targets: ["PovioKitUIKit"]
+ ),
+ .library(
+ name: "PovioKitSwiftUI",
+ targets: ["PovioKitSwiftUI"]
+ ),
+ .library(
+ name: "PovioKitAsync",
+ targets: ["PovioKitAsync"]
+ ),
],
dependencies: [
- .package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.0.0"))
+ .package(
+ url: "https://github.com/Alamofire/Alamofire",
+ .upToNextMajor(from: "5.0.0")
+ )
],
targets: [
.target(
@@ -25,7 +51,6 @@ let package = Package(
.target(
name: "PovioKitNetworking",
dependencies: [
- "PovioKitCore",
"Alamofire",
"PovioKitPromise",
],
@@ -39,19 +64,35 @@ let package = Package(
resources: [.copy("../../Resources/PrivacyInfo.xcprivacy")]
),
.target(
- name: "PovioKitUI",
+ name: "PovioKitUIKit",
+ dependencies: [
+ "PovioKitCore",
+ "PovioKitUtilities",
+ ],
+ path: "Sources/UI/UIKit",
+ resources: [.copy("../../../Resources/PrivacyInfo.xcprivacy")]
+ ),
+ .target(
+ name: "PovioKitSwiftUI",
dependencies: [
- "PovioKitCore"
+ "PovioKitCore",
],
- path: "Sources/UI",
+ path: "Sources/UI/SwiftUI",
resources: [.copy("../../../Resources/PrivacyInfo.xcprivacy")]
),
.target(
- name: "PovioKitAsync",
- dependencies: [
- ],
- path: "Sources/Async",
- resources: [.copy("../../../Resources/PrivacyInfo.xcprivacy")]
+ name: "PovioKitUtilities",
+ dependencies: [
+ "PovioKitCore",
+ ],
+ path: "Sources/Utilities",
+ resources: [.copy("../../Resources/PrivacyInfo.xcprivacy")]
+ ),
+ .target(
+ name: "PovioKitAsync",
+ dependencies: [],
+ path: "Sources/Async",
+ resources: [.copy("../../Resources/PrivacyInfo.xcprivacy")]
),
.testTarget(
name: "Tests",
@@ -59,7 +100,9 @@ let package = Package(
"PovioKitCore",
"PovioKitPromise",
"PovioKitNetworking",
- "PovioKitUI",
+ "PovioKitUIKit",
+ "PovioKitSwiftUI",
+ "PovioKitUtilities",
"PovioKitAsync",
]
),
diff --git a/README.md b/README.md
index 32cc23cc..2dd31156 100644
--- a/README.md
+++ b/README.md
@@ -23,20 +23,23 @@
## Packages
-| [Core](Resources/Core) | [UI](Resources/UI) | [Networking](Resources/Networking) | [PromiseKit](Resources/PromiseKit) |
-| :-: | :-: | :-: | :-: |
+| [Core](Resources/Core) | [Networking](Resources/Networking) | [PromiseKit](Resources/PromiseKit) | [Utilities](Resources/Utilities) | [Async](Resources/Async) | [UIKit](Resources/UI/UIKit) | [SwiftUI](Resources/UI/SwiftUI) |
+| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
## Installation
### Swift Package Manager
- In Xcode, click `File` -> `Add Package Dependencies...`
- Insert `https://github.com/poviolabs/PovioKit` in the Search field.
-- Select a desired `Dependency Rule`. Usually "Up to Next Major Version" with "3.0.0".
+- Select a desired `Dependency Rule`. Usually "Up to Next Major Version" with "4.0.0".
- Select "Add Package" button and check one or all given products from the list:
- *PovioKitCore* (core library)
- - *PovioKitNetworking* (networking library, depends on `core` and `promise` package)
+ - *PovioKitNetworking* (networking library built on top of Alamofire, has dependency on `PovioKitPromise` package)
- *PovioKitPromise* (lightweight promises library)
- - *PovioKitUI* (UI components)
+ - *PovioKitUtilities* (utility components, has dependency on `PovioKitCore` package)
+ - *PovioKitAsync* (async/await components)
+ - *PovioKitUIKit* (UIKit components, has dependency on `PovioKitCore` and `PovioKitUtilities` package)
+ - *PovioKitSwiftUI* (SwiftUI components, has dependency on `PovioKitCore` package)
- Select "Add Package" again and you are done.
### Migration
diff --git a/Resources/Async/README.md b/Resources/Async/README.md
new file mode 100644
index 00000000..b188d1cf
--- /dev/null
+++ b/Resources/Async/README.md
@@ -0,0 +1,8 @@
+# PovioKit: Async
+
+A package that includes async components and tools.
+
+### Components
+| Component | Description |
+| :--- | :--- |
+| [AsyncThrottleSequence](/Sources/Async/AsyncThrottleSequence.swift) | A wrapper around an `AsyncSequence` that introduces a delay between tasks to control the rate at which elements are emitted. |
diff --git a/Resources/Core/Utilities/Logger/README.md b/Resources/Core/Logger/README.md
similarity index 71%
rename from Resources/Core/Utilities/Logger/README.md
rename to Resources/Core/Logger/README.md
index b3d017d7..6739df5e 100644
--- a/Resources/Core/Utilities/Logger/README.md
+++ b/Resources/Core/Logger/README.md
@@ -1,10 +1,10 @@
# Logger
-Simple console logger.
+Simple, yet performant console logger built on top of [OSLog](https://developer.apple.com/documentation/os/logging) framework.
## Log Levels
-There is 6 levels defined to choose from
+There are 6 levels defined to choose from
* info
* warn
* debug
@@ -30,4 +30,4 @@ Logger.debug("Something went wrong", params: ["objectId": 1])
```
## Source code
-You can find source code [here](/Sources/Core/Utilities/Logger/Logger.swift).
+You can find source code [here](/Sources/Core/Logger/Logger.swift).
diff --git a/Resources/Core/README.md b/Resources/Core/README.md
index c33f251a..655542d0 100644
--- a/Resources/Core/README.md
+++ b/Resources/Core/README.md
@@ -1,25 +1,12 @@
# PovioKit: Core
-Core package including essentials needed for development and other packages.
+Core package includes essentials needed for the development and for other packages.
-### Utilities
-
-| Utilities |
+### Essentials
+| Components |
| :--- |
-| [AppVersionValidator](/Sources/Core/Utilities/AppVersionValidator/AppVersionValidator.swift) |
-| [AttributedStringBuilder](Utilities/AttributedStringBuilder) |
-| [Broadcast](Utilities/Broadcast) |
-| [BundleReader](/Sources/Core/Utilities/BundleReader/BundleReader.swift) |
-| [ColorInterpolator](Utilities/ColorInterpolator) |
-| [Delegated](Utilities/Delegated) |
-| [DispatchTimer](Utilities/DispatchTimer) |
-| [ImageSource](/Sources/Core/Utilities/ImageSource/ImageSource.swift) |
-| [Logger](Utilities/Logger) |
-| [Money](Utilities/Money) |
-| [StartupService](Utilities/StartupService) |
-| [Throttler](Utilities/Throttler) |
-| [UserDefaults](Utilities/PropertyWrapper/UserDefaults) |
-| [XCConfigValue](Utilities/PropertyWrapper/XCConfigValue) |
+| [Logger](Logger) |
+
### Extensions
@@ -39,7 +26,3 @@ Core package including essentials needed for development and other packages.
| [UITableViewHeaderFooterView](/Sources/Core/Extensions/UIKit/UITableViewHeaderFooterView+PovioKit.swift) | | |
| [UIView](/Sources/Core/Extensions/UIKit/UIView+PovioKit.swift) | | |
| [UIViewController](/Sources/Core/Extensions/UIKit/UIViewController+PovioKit.swift) | | |
-
-
-
-
diff --git a/Resources/Networking/README.md b/Resources/Networking/README.md
index 8184dddb..7fed05f1 100644
--- a/Resources/Networking/README.md
+++ b/Resources/Networking/README.md
@@ -2,7 +2,6 @@
High-level network client abstraction based on [Alamofire](https://github.com/Alamofire/Alamofire).
-
## Usage
#### Retreiving JSON object from an endpoint
diff --git a/Resources/UI/README.md b/Resources/UI/README.md
deleted file mode 100644
index a77c9930..00000000
--- a/Resources/UI/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# PovioKit: UI
-
-UI package including components to simplify building layouts.
-
-### Components
-
-| Components |
-| :--- |
-| [ActionButton](ActionButton) |
-| [Camera](Camera) |
-| [DynamicCollectionCell](DynamicCollectionCell) |
-| [GradientView](GradientView) |
-| [PaddingLabel](PaddingLabel) |
-| [ProfileImageView](ProfileImageView) |
-| [TextField](TextField) |
diff --git a/Resources/UI/ActionButton/README.md b/Resources/UI/SwiftUI/ActionButton/README.md
similarity index 95%
rename from Resources/UI/ActionButton/README.md
rename to Resources/UI/SwiftUI/ActionButton/README.md
index fd362a25..ece59325 100644
--- a/Resources/UI/ActionButton/README.md
+++ b/Resources/UI/SwiftUI/ActionButton/README.md
@@ -53,4 +53,4 @@ actionButton.titleRightImage = .init(image: Image(systemName: "arrow.right"), si
```
## Source code
-You can find source code [here](/Sources/UI/ActionButton/ActionButton.swift).
+You can find source code [here](/Sources/UI/SwiftUI/Views/ActionButton/ActionButton.swift).
diff --git a/Resources/UI/ProfileImageView/README.md b/Resources/UI/SwiftUI/ProfileImageView/README.md
similarity index 96%
rename from Resources/UI/ProfileImageView/README.md
rename to Resources/UI/SwiftUI/ProfileImageView/README.md
index 659bcd4a..55ec8a4e 100644
--- a/Resources/UI/ProfileImageView/README.md
+++ b/Resources/UI/SwiftUI/ProfileImageView/README.md
@@ -73,4 +73,4 @@ profileImageView.set(