Navigating with UINavigationController

Now you have a navigation controller, a navigation bar, and two view controllers. Time to put all the pieces together. The user should be able to tap a row in ItemsViewController’s table view and have the ItemDetailViewController’s view slide onto the screen and display the properties of the selected Possession instance.

Pushing view controllers

Of course, you need to create an instance of ItemDetailViewController. Where should this object be created? Think back to previous exercises where you instantiated all of your controllers in the method application:​didFinishLaunchingWithOptions:. For example, in the Chapter 7 chapter, you created both view controllers and immediately added them to tab bar controller’s ...

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.