ApplicationCoordinator alternatives and similar libraries
Based on the "App Routing" category.
Alternatively, view ApplicationCoordinator alternatives based on common mentions on social networks and blogs.
-
CTMediator
The mediator with no regist process to split your iOS Project into multiple project. -
RxFlow
RxFlow is a navigation framework for iOS applications based on a Reactive Flow Coordinator pattern -
RouteComposer
Protocol oriented, Cocoa UI abstractions based library that helps to handle view controllers composition, navigation and deep linking tasks in the iOS application. Can be used as the universal replacement for the Coordinator pattern. -
ZIKRouter
Interface-oriented router for discovering modules, and injecting dependencies with protocol in Objective-C and Swift. -
Composable Navigator
An open source library for building deep-linkable SwiftUI applications with composition, testing and ergonomics in mind -
SwiftCurrent
A library for managing complex workflows in Swift -
LightRoute
LiteRoute is easy transition for your app. Written on Swift 4 -
DZURLRoute
DZURLRoute是支持基于标准URL进行Native页面间跳转的Objective-C实现。方便您架构页面之间高内聚低耦合的开发模式。他的核心思想是把每一个页面当成一个资源,通过标准的URL协议(统一资源定位符)来定位到每一个可触达的页面(资源)。 -
CoreNavigation
📱📲 Navigate between view controllers with ease. 💫 🔜 More stable version (written in Swift 5) coming soon. -
MonarchRouter
Declarative URL- and state-based router written in Swift. -
Weavy
Reactive navigation framework based on a weaving pattern (fits well with RxSwift) -
📲 ScreenUI
A multi-platform, multi-paradigm routing framework.
Appwrite - The open-source backend cloud platform
Do you think we are missing an alternative of ApplicationCoordinator or a related project?
README
ApplicationCoordinator
A lot of developers need to change navigation flow frequently, because it depends on business tasks. And they spend a huge amount of time for re-writing code. In this approach, I demonstrate our implementation of Coordinators, the creation of a protocol-oriented, testable architecture written on pure Swift without the downcast and, also to avoid the violation of the S.O.L.I.D. principles.
Based on the post about Application Coordinators khanlou.com and Application Controller pattern description martinfowler.com.
Coordinators Essential tutorial. Part I medium.com
Coordinators Essential tutorial. Part II medium.com
Example provides very basic structure with 6 controllers and 5 coordinators with mock data and logic.
I used a protocol for coordinators in this example:
protocol Coordinator: class {
func start()
func start(with option: DeepLinkOption?)
}
All flow controllers have a protocols (we need to configure blocks and handle callbacks in coordinators):
protocol ItemsListView: BaseView {
var authNeed: (() -> ())? { get set }
var onItemSelect: (ItemList -> ())? { get set }
var onCreateButtonTap: (() -> ())? { get set }
}
In this example I use factories for creating coordinators and controllers (we can mock them in tests).
protocol CoordinatorFactory {
func makeItemCoordinator(navController navController: UINavigationController?) -> Coordinator
func makeItemCoordinator() -> Coordinator
func makeItemCreationCoordinatorBox(navController: UINavigationController?) ->
(configurator: Coordinator & ItemCreateCoordinatorOutput,
toPresent: Presentable?)
}
The base coordinator stores dependencies of child coordinators
class BaseCoordinator: Coordinator {
var childCoordinators: [Coordinator] = []
func start() { }
func start(with option: DeepLinkOption?) { }
// add only unique object
func addDependency(_ coordinator: Coordinator) {
for element in childCoordinators {
if element === coordinator { return }
}
childCoordinators.append(coordinator)
}
func removeDependency(_ coordinator: Coordinator?) {
guard
childCoordinators.isEmpty == false,
let coordinator = coordinator
else { return }
for (index, element) in childCoordinators.enumerated() {
if element === coordinator {
childCoordinators.remove(at: index)
break
}
}
}
}
AppDelegate store lazy reference for the Application Coordinator
var rootController: UINavigationController {
return self.window!.rootViewController as! UINavigationController
}
private lazy var applicationCoordinator: Coordinator = self.makeCoordinator()
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let notification = launchOptions?[.remoteNotification] as? [String: AnyObject]
let deepLink = DeepLinkOption.build(with: notification)
applicationCoordinator.start(with: deepLink)
return true
}
private func makeCoordinator() -> Coordinator {
return ApplicationCoordinator(
router: RouterImp(rootController: self.rootController),
coordinatorFactory: CoordinatorFactoryImp()
)
}