O'Reilly logo

iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch by Maher Ali

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 6. View Controllers

The model view controller (MVC) is a popular design pattern that is used in software construction to isolate the business logic from the graphical user interface. In MVC, a controller is used for the purpose of coordination between the model (where the business logic resides) and the view (where the user's interactions occur).

In this chapter, you will learn about the available view controllers that are provided to you in the iPhone SDK. Although you can build iPhone applications without the use of these view controllers, you shouldn't. As you will see in this chapter, view controllers greatly simplify your application.

The organization of this chapter is as follows. In Section 6.1, we provide a gentle introduction to view controllers by presenting a simple application with a single view controller. This application will demonstrate important view controller concepts. In Section 6.2, we talk about tab bar controllers and how they can be used in the construction of radio interfaces. In Section 6.3, we talk about navigation controllers used primarily for presenting hierarchical information to the user. After that, Section 6.4 talks about modal view controllers and provides a detailed example showing their appropriate usage. Finally, we summarize the chapter in Section 6.5.

The Simplest View Controller

In this section, we will demonstrate the simplest view controller. The application is composed of a view, a view controller, and a data model. The application ...

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