A Coordinator
is an object that manages iOS applications navigation flow while keeping UIViewController
s separate and independent.
By itself a Coordinator
can only hold references to others Coordinator
s and to his parent coordinator (if available), to gain navigation flow management it must be paired with a UINavigationController
or UITabBarController
.
Choose one of the two protocol
s based on your navigation flow needs:
-
NavCoordinator
Holding aUINavigationController
-
TabCoordinator
Holding aUITabBarController
- Push a
UIViewController
/UINavigationController
/UTabBarController
of anotherCoordinator
- Create
Couple
s object - Present
Coordinator
s - Be invisible to
UIViewController
s and only known byViewModel
s - Hold
Dependencies
in case of Dependency Injection
- Perform anything other than navigation (i.e. network calls)
- Close Xcode
- If not already present, create a folder named
Source
in the following path:~/Library/Developer/Xcode/Templates/File Templates/
- Move the
.xctemplate
s of choice in:~/Library/Developer/Xcode/Templates/File Templates/Source/
- Open Xcode and try to create a new file with:
Xcode > File > New > File...
- Xcode 10.0+
- Swift 4.2+
- iOS 8.0+
- Sketch 53+
- Soroush Khanlou, for his original
Coordinator
proposal- The Coordinator (January 20, 2015)
- Coordinators Redux (October 05, 2015)
- Presenting Coordinators 📹 (October 30, 2015)
- Migrating To Coordinators (April 25, 2017)
- Model Mutation In Coordinators (May 02, 2017)
- Back Buttons and Coordinators (May 08, 2017)
- Martin Fowler, for his original
Application Controller
concept