Flow Manager MVC Intent 1. Get Model 2. Setup Flow Dependent Elements 3. Presents MVC Intent 1. Get Model 2. Setup Flow Dependent Elements 3. Presents MVC Intent 1. Get Model 2. Setup Flow Dependent Elements 3. Presents MVC Intent 1. Get Model 2. Setup Flow Dependent Elements 3. Presents MVC Intent 1. Get Model 2. Setup Flow Dependent Elements 3. Presents
Flow Controller 1. Keep the application’s state 2. Manage the logic between view controllers 3. Orchestrate the view controllers 4. Prevent view controller dependencies 5. Handle a portion of the application
Inherits from UIResponder with a reference to a root UIViewController Inherits from UIViewController UINavigationController, UITabBarController, or custom container view controller
View controllers report via delegate with lots of delegate protocols in a complex view controller hierarchy View controllers report via the responder chain low key introducing the Event and EventHandler protocols
EventHandler protocol • Implement to receive Events • Specifies the event that can keep being propagated down the responder chain or no event to propagate protocol EventHandler: AnyObject { func handleEvent(_ event: Event) -> Event? }
UIResponder extension • func postEvent(_ event: Event) propagates the event up the responder chain • var eventHandler: EventHandler? can be used to hook an object that is not part of the responder chain