Performing navigation well
Navigation is a critical component in UIKit and iOS development. Navigation allows us to move the user from one UIViewController to another intuitively and simply.
There are two ways of navigating the user to another screen:
- Present a modal view controller: If we need to present a screen with a task to complete or to make a decision, a view controller can present another view controller on top of it.
- Push another view controller: If we want to navigate the user down the app hierarchy to the next stage, we can push a new view controller to the stack. This technique requires a UINavigationController to handle the push and pop operations and provide a navigation bar to ease the transitions.
Interviewers do not generally ask questions about the push and present, as these actions are fairly simple to understand and implement. Most questions and challenges are related to transitions, navigation bars, life cycle methods, and design patterns...