More Modal View Controllers

In this part of the chapter, you will update Homepwner to present the BNRDetailViewController modally when the user creates a new BNRItem (Figure 17.3). When the user selects an existing BNRItem, the BNRDetailViewController will be pushed onto the UINavigationController’s stack as before.

Figure 17.3  New item

New item

To implement this dual usage of BNRDetailViewController, you will give it a new designated initializer, initForNewItem:. This initializer will check whether the instance is being used to create a new BNRItem or to show an existing one. Then it will configure the interface accordingly.

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

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