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, replacewindowatAppDelegate.swift. - Add your own (if required)
CoordinatorTypes andCallbackTypes. - Specify how each module will load using
addModuleCoordinatororaddCoordinator.- Use
addModuleCoordinatorto actually show module.ModuleCoordinatorcan own modules. - Use
addCoordinatorto addCoordinator, whith ownsModuleCoordinator.ApplicationCoordinatorcan ownModuleCoordinatordirectly. I am sure, in most cases you will need onlyaddModuleCoordinator.
- Use
- Call
loadCoordinatorwhen you need to activate coordinator. If it isModuleCoordinatorit will show predefined module.Coordinatorwill usestartActionto launch. - Use
setDependencyto define what coordinator (and its modules) should unload when some other coordinator loading. - Not to forget provide required callbacks to coordinators. And implement
CoordinatorModuleProtocolin 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.