Understanding UIViewControllers

iOS development and the associated libraries make heavy use of the Model View Controller (MVC) pattern. In general, MVC is a strategy for separating the presentation (View), data (Model), and business logic (Controller). In specific terms, the model is simply data, like a Person class or an Address. The view is responsible for rendering the data to the screen. In iOS development, that means a subclass of UIView. iOS provides a special class to act as the controller for a UIView, which is aptly named UIViewController.

UIViewController has two key characteristics: it is often associated with an XIB file and it has a property called “view” that is of type UIView. By creating a subclass of UIViewController, we can ...

Get Beginning iOS 5 Games Development: Using the iOS 5 SDK for iPad, iPhone, and iPod Touch now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.