Using a Navigation Controller in the Master View

Before I explain how to replace one view controller with another, I want to make it clear that I am in no way saying I never want to do the traditional kind of Navigation Controller navigation on the iPad. For example, I might want to use a Navigation controller in the Master view. I’ll show you how to do that by creating a segue — a storyboard object that creates a transition from one view controller to another — so that when you select Test Drive in the Master view, the Test Drive view will slide into place, Back button and all, in the Master view (as opposed to the Detail view which had been the case). Then, when you tap the Back button, you’ll be back in the Master view.

I’m doing this just to show you how to do it. After I explain it, I’ll have you go back to having the Test Drive view display in the Detail view.

1. Select MainStoryboard_iPad in the Project navigator.

The storyboard will appear.

2. Select the Test Drive cell, control-drag it to the Test Drive controller, as I have done in Figure 13-5, and then release the mouse button.

You’ll see the pop-up menu that allows you to select the Storyboard Segues type, as shown in Figure 13-6.

3. Choose Push.

You’ll notice that the Test Drive view resizes to the same size as the Master view.

Select the segue in the Document Outline, as I have in Figure 13-7. The Attributes inspector shows you that the Destination is set to Current. (Current is in fact the default.) That means ...

Get iPad Application Development For Dummies, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.