7View Controllers

View Controllers and XIB Files

In the Quiz application, you had one screen, one controller, and one XIB file:

Figure 7.1  Quiz, a single screen application

Quiz, a single screen application

But what about applications with multiple screens? Typically, each screen gets its own controller and XIB file. Figure 7.2 shows an example application with two screens and the resulting controllers and XIB files.

Figure 7.2  Example of an application with two screens

Example of an application with two screens

Each controller has a view that gets placed on the window. (The view often has subviews like buttons and ...

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.