In my talk, I’ll present coordinators, which are a novel way to manage view controllers, enable re-use, and generally provide structure to code. Coordinators are objects that control flow in an app. Coordinators are typically initialized with a navigation controller, although they can manage other types of view controllers as well. View controllers are totally transparent to coordinators; view controllers display data as directed by their coordinator and bubble up events as delegate methods, which the coordinators respond to. This makes reusing view controllers completely trivial, since the view controller doesn’t bring any baggage along with it.
Much like views and view controllers, coordinators are found in a tree structure. The root coordinator is called the app coordinator, and contains the code for setting up the root view controller, which you might typically find in an app delegate. Swapping out app coordinators could change your app from an iPad layout to an iPhone layout.
When a coordinator begins doing too many tasks, those tasks can be pushed down into a child coordinator. Complexity can easily be managed, and it has space for growth. The using the coordinator model is a simpler way of managing iOS apps and is a great tool for slimming down large view controllers.
- Soroush Khanlou
NSSpain 2015