CoordinatorFlow
What
CoordinatorFlow implements coordinator router pattern and makes it faster and easier to use, decreasing amount of required code. Just put all rout routine in one file and let controllers (or modules) just do their business.
Example
Installation
CoordinatorFlow is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CoordinatorFlow'
Usage
- Create
ApplicationCoordinator
, replacewindow
atAppDelegate.swift
. - Add your own (if required)
CoordinatorType
s andCallbackType
s. - Specify how each module will load using
addModuleCoordinator
oraddCoordinator
.- Use
addModuleCoordinator
to actually show module.ModuleCoordinator
can own modules. - Use
addCoordinator
to addCoordinator
, whith ownsModuleCoordinator
.ApplicationCoordinator
can ownModuleCoordinator
directly. I am sure, in most cases you will need onlyaddModuleCoordinator
.
- Use
- Call
loadCoordinator
when you need to activate coordinator. If it isModuleCoordinator
it will show predefined module.Coordinator
will usestartAction
to launch. - Use
setDependency
to define what coordinator (and its modules) should unload when some other coordinator loading. - Not to forget provide required callbacks to coordinators. And implement
CoordinatorModuleProtocol
in a module to let it interact with coordinators.
TODO
- Customization
- Transitions
License
CoordinatorFlow is available under the MIT license. See the LICENSE file for more info.