View controllers are a set of classes in UIKit that implement common user interface design patterns for presenting numerous application views to the user on iPhone OS. By using view controllers, you eliminate redundant code in your applications and provide a consistent and familiar user interface. View controllers provide support for tab bars, navigation bars, modal views, and table views. View controllers also simplify autorotating your user interface when the orientation changes.
Note: This document does not reflect the changes to view controller management that were introduced in iPhone OS 3.0.
You should read this document if you are implementing an iPhone OS application. Most productivity applications that contain a lot of user data or records benefit from using view controllers to organize and present content on small hand-held devices. Even a single view graphics application benefits from using view controllers for autorotation.
This article provides an introduction to view controllers and explains why you should use them:
“What Are View Controllers?” describes the benefits of using view controllers and how they fit into the Model-View-Controller design pattern.
These articles describe the user interface and object-oriented designs implemented by view controllers:
“User Interface Design Patterns” describes the common user interface design patterns used in iPhone OS. You use view controllers to implement these types of user interfaces.
“View Controller Classes” provides an overview of the different view controller classes and how they relate to other classes you use to implement your user interface.
These articles cover common programming tasks—they contain step-by-step instructions and sample code:
“Using View Controllers” describes the root view controller class that you subclass to manage your application views.
“Using Tab Bar Controllers” describes how to use a tab bar controller to create a radio-style interface.
“Using Navigation Controllers” describes how to use a navigation controller to create a navigation-style interface including how to set up navigation items for your application views.
“Using Modal View Controllers” describes how to use modal view controllers to present a view on top of another view.
“Combining Tab Bar and Navigation Controllers” describes how to combine different types of controllers for more complex user interfaces—for example, how to wrap a view controller in a navigation controller and add it to a tab bar controller.
“Using Table Views for Hierarchical Data” describes how to use a table view controller to represent hierarchical data. Explains how to create a drill-down user interface using table views and explains how to allow editing of table content.
“Autorotating Views” describes how to autorotate your user interface when the orientation changes.
If you are new to development for iPhone OS, read these documents first:
iPhone Application Programming Guide provides fundamental information about how to create iPhone OS applications, including information about the core application architecture, event handling, and graphics management.
iPhone Human Interface Guidelines provides user interface guidelines for designing iPhone OS applications.
If you are using Interface Builder to create view controllers, read “iPhone OS Interface Objects” in Interface Builder User Guide.
If you want to use table views for hierarchical data, read Table View Programming Guide for iPhone OS after this guide.
Last updated: 2009-05-28