This PR contains the work done to define the `Coordinator` and the `Router` public protocols, and also implemented a few concrete router implementations tailored for the **UIKit** framework. To provide further details about the work done: - [x] define a new, dedicated `Coordinator` target in the `Package` file; - [x] define the `Coordinator` and the `Router` public protocols used to implement the coordinator pattern; - [x] implemented some **UIKit** specific routers to use on the **iOS** platform: `ModalNavigationRouter`, `PushNavigationRouter` and the `WindowRouter` concrete routers. Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Reviewed-on: #2
58 lines
1.1 KiB
Swift
58 lines
1.1 KiB
Swift
// swift-tools-version: 5.8
|
|
|
|
import PackageDescription
|
|
|
|
private var excludePlatforms: [String] = [.PlatformFolder.iOS]
|
|
|
|
#if os(iOS)
|
|
excludePlatforms = []
|
|
#endif
|
|
|
|
let package = Package(
|
|
name: "SwiftLibs",
|
|
products: [
|
|
.library(
|
|
name: "SwiftLibs",
|
|
targets: [
|
|
"Coordinator",
|
|
"Core"
|
|
]
|
|
),
|
|
],
|
|
dependencies: [],
|
|
targets: [
|
|
.target(
|
|
name: "Coordinator",
|
|
dependencies: [],
|
|
exclude: excludePlatforms
|
|
),
|
|
.target(
|
|
name: "Core",
|
|
dependencies: []
|
|
),
|
|
.testTarget(
|
|
name: "CoordinatorTests",
|
|
dependencies: [
|
|
"Coordinator"
|
|
],
|
|
path: "Tests/Coordinator",
|
|
exclude: excludePlatforms
|
|
),
|
|
.testTarget(
|
|
name: "CoreTests",
|
|
dependencies: [
|
|
"Core"
|
|
],
|
|
path: "Tests/Core"
|
|
),
|
|
]
|
|
)
|
|
|
|
// MARK: - String+Constants
|
|
|
|
private extension String {
|
|
enum PlatformFolder {
|
|
static let iOS = "Platform/iOS"
|
|
}
|
|
}
|