Navigation Controllers
Let’s take stock of where we are with our app. We have two scenes—the episodes list and the media player—that currently have no relationship to one another. The only reason either works is that we reset the “Is initial view controller” setting in the AppDelegate. But what we want, of course, is for selecting an episode in the table to bring up the player for that episode. We need to navigate from one scene to the other.
The most common tool for achieving this on iOS is the UINavigationController, a view controller that manages a stack of other view controllers. Typically, it starts with a “root” view controller, and then when we want to show another view controller, we put the new one on the top stack. When we want to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access