Chapter 4. The Split View

WHAT'S IN THIS CHAPTER?

  • How to create a Split View-based application

  • How to link data from the RootViewController with the DetailViewController

  • How to handle orientation changes

The split view is a unique combination of views in a master-detail relationship that gives the user a different visual experience depending on the orientation of the iPad. The master is the RootViewController and the detail is the DetailViewController. In landscape mode, both the master and detail views are visible. The master view is a list of options on the left of the screen. When an option is selected, the result occurs in the detail view. In portrait mode, however, the detail takes up the entire view and the master view is available as a popup. The master is accessible through a button on the toolbar on the detail view. Tapping the button reveals a popup controller with the contents of the master view, so selections can still be made.

In this chapter you build an application that demonstrates this master-detail relationship, and add gestures that emulate the flipping of a page.

THE UISPLITVIEWCONTROLLER CLASS

The UISplitViewController class manages two ViewController classes in a master-detail relationship. By default, the master view is a table view controller, but the detail view can be determined by the developer.

The UISplitViewController does not provide any interface by itself; rather, it manages the RootViewController and DetailViewController — especially with respect to the ...

Get Professional iPhone® and iPad™ Application Development 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.