Navigation framework for iOS applications based on a Coordinator pattern
Navigation framework for iOS applications based on a Coordinator pattern
Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
To integrate Moordinator
into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:
dependencies: [
.package(url: "https://github.com/GSM-MSG/Moordinator.git", .upToNextMajor(from: "2.0.0"))
]
If you prefer not to use either of the aforementioned dependency managers, you can integrate Moordinator into your project manually.
// create a path
import Moordinator
enum ExRoutePath: RoutePath {
case main
}
// create a moordinator
import Moordinator
import Combine
import UIKit
final class MainMoordinator: Moordinator {
private let rootVC = UINavigationController()
var root: Presentable {
rootVC
}
// navigation
func route(to path: RoutePath) -> MoordinatorContributors {
guard let path = path as? ExRoutePath else { return .none }
switch path {
case .main:
let vc = UIViewController()
rootVC.setViewControllers([vc], animated: true)
return .one(.contribute(withNextPresentable: vc, withNextRouter: vc))
}
return .none
}
}
link |
Stars: 4 |
Last commit: 1 week ago |
Full Changelog: https://github.com/GSM-MSG/Moordinator/compare/2.0.0...2.1.0
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics