The Split View Controller

The UISplitViewController class is a view controller that simply manages the presentation of two side-by-side view controllers in Landscape orientation — it is, in this respect, a container controller. It has no interface — its job is to coordinate the presentation of its two view controllers and to manage the transitions between different orientations.

Using this class, a view controller is created on the left which is referred to as the Master view (and is named that in the template), which presents a list of items, and another view controller on the right, which presents the details, or content, of the selected item and which is referred to as the Detail view, (and is named that in the template).

After you create and initialize a UISplitViewController object, you assign two view controllers to it by using the viewControllers property — an array that contains the two (and only the two) controllers. The first view controller (index 0) is displayed on the left side (in the case of RoadTrip, the RTMasterViewController) and the second view controller (index 1) is displayed on the right side (the RTDetailViewController).

All of this is set up for you in the storyboard. (See Figure 13-9) You’ll notice that both of the view controllers managed by the Split View controllers are embedded in Navigation controllers, which is why when you select a cell in the RTMasterViewController view, a Navigation bar appears with a Back button (in either the Master or Detail ...

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.