navigation has a delegate • Our root View Controller is MasterNavigationViewController: UINavigationController • MasterNavigationViewController configures every VC and is its delegate
a view controller • Code duplication and/or implicit dependencies between delegates • Generally lots of boilerplate; everything has a navigation delegate!
grows, this top level VC will likely house other logic control logic • Still tied to all the VC lifetime magic of UIKit • The VC delegate can easily get bloated with all kinds of tasks, not just nav
• Not tied to View Controller life cycle or responsibilites • We can use Navigator Protocols to not have to repeat boilerplate... • ...and to group functionality
in extensions • The AppDelegate creates and runs the AppNavigator • AppNavigator sets up your rootVC and keeps a reference to it • AppNavigator has one job; manage app wide navigation • AppNavigator is not a view controller, just a class
protocols by functionality rather than by VC, we've avoided lots of boilerplate... • ...and code duplication. • We are no longer coupled to the VC lifecycle.
• View Controllers should avoid any assumptions about where they live in the app • Navigators capture the "flow" of these individual entities • Navigators allow us to separate the what from the how