O'Reilly logo

iPhone and iPad App 24-Hour Trainer by Gene Backlin, Abhishek Mishra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12

Navigation Controllers

A lot of applications for Apple’s iOS devices display information on more than one view controller. On the iPad, for example, there is even a split view that displays two view controllers at once. The iPhone doesn’t have that luxury, so it must provide a way to navigate through a hierarchy of view controllers.

To be able to navigate from view controller to view controller, by either drilling down into a hierarchy of views controllers or returning back to the original view controller, there has to be a process to accomplish this.

Apple has provided developers with a navigation controller that manages the presentation of these view controllers in your application. The class provided is UINavigationController that controls a hierarchy of UIViewController classes.

The UIViewController class contains a view property that contains your custom view information for user interaction. This view is what users see on their device. This custom user interface is designed using the Xcode Interface Builder editor as shown in Figure 12-1.

In this lesson you learn how to add a navigation controller to your single view application. You learn how to navigate from one view controller to another, including returning back to the original root view controller. You also learn how to transfer data from one view controller to another.

note.eps
This lesson requires you to add the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required