Coordinator
A drop-in, ready to use, collection of Coordinator protocols
Install / Use
/learn @giulio92/CoordinatorREADME
<p align="center">
<img src="https://github.com/giulio92/Coordinator/blob/master/GitHub%20Page/logo.png" width="500">
</p>
<p align="center"> <a href=""><img src="https://img.shields.io/badge/language-Swift%204.2-orange.svg"></a> <a href=""><img src="https://img.shields.io/badge/platform-iOS-lightgrey.svg"></a> <a href=""><img src="https://travis-ci.org/giulio92/Coordinator.svg?branch=master"></a> <a href="https://codebeat.co/projects/github-com-giulio92-coordinator-master"><img src="https://codebeat.co/badges/9a6dfd01-5249-476c-99b6-4f420cb9bbbe"></a> <a href="https://github.com/giulio92/Coordinator/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg"></a> </p>What a
What a
<p align="center"> <a href=""><img src="https://img.shields.io/badge/language-Swift%204.2-orange.svg"></a> <a href=""><img src="https://img.shields.io/badge/platform-iOS-lightgrey.svg"></a> <a href=""><img src="https://travis-ci.org/giulio92/Coordinator.svg?branch=master"></a> <a href="https://codebeat.co/projects/github-com-giulio92-coordinator-master"><img src="https://codebeat.co/badges/9a6dfd01-5249-476c-99b6-4f420cb9bbbe"></a> <a href="https://github.com/giulio92/Coordinator/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg"></a> </p>
Concepts
A Coordinator is an object that manages iOS applications navigation flow while keeping UIViewControllers separate and independent.
By itself a Coordinator can only hold references to others Coordinators 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 protocols based on your navigation flow needs:
-
NavCoordinator
Holding aUINavigationController -
TabCoordinator
Holding aUITabBarController
What a Coordinator should do
- Push a
UIViewController/UINavigationController/UTabBarControllerof anotherCoordinator - Create
Couples object - Present
Coordinators - Be invisible to
UIViewControllers and only known byViewModels - Hold
Dependenciesin case of Dependency Injection
What a Coordinator should not do
- Perform anything other than navigation (i.e. network calls)
How to use Xcode Templates
- Close Xcode
- If not already present, create a folder named
Sourcein the following path:~/Library/Developer/Xcode/Templates/File Templates/ - Move the
.xctemplates of choice in:~/Library/Developer/Xcode/Templates/File Templates/Source/ - Open Xcode and try to create a new file with:
Xcode > File > New > File...
Example project requirements
- Xcode 10.0+
- Swift 4.2+
- iOS 8.0+
Image source requirements
- Sketch 53+
Credits
- Soroush Khanlou, for his original
Coordinatorproposal- 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 Controllerconcept
