O'Reilly logo

Programming iOS 4 by Matt Neuburg

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

Navigation Controllers

A navigation controller (UINavigationController, a subclass of UIViewController) is the most elaborate and powerful of the built-in view controller classes. It is a brilliant solution to the problem of presenting multiple interfaces and options on the tiny iPhone screen. But you might use it also just because its basic interface is useful and familiar to users.

A navigation controller’s interface has three parts:

The central view
A navigation controller is a container for other view controllers, and is responsible for displaying the view of one of these at all times. The “navigation” part has to do with how it decides which view controller’s view to display. The navigation controller contains its view controllers in a stack. When a view controller is pushed onto the stack, it becomes the top view controller, and its view becomes the central view (with, by default, an animation from the right). When a view controller is popped from the stack, the view controller underneath it becomes the top view controller, and its view becomes the central view (with, by default, an animation from the left). This behavior is coordinated with the behavior of the navigation bar, as we shall now see.
The navigation bar

A navigation bar (a UINavigationBar) is a rectangular view displaying a left item, a center item, and a right item. It can be used independently, but it is most often used as part of a navigation controller interface, in which case it appears at the top (and ...

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