The Auto Layout System

In Chapter 4, you learned that a view’s frame specifies its size and position relative to its superview. So far, you have defined the frames of your views with absolute coordinates either programmatically or by configuring them in Interface Builder. Absolute coordinates, however, make your layout fragile because they assume that you know the size of the screen ahead of time.

Using Auto Layout, you can describe the layout of your views in a relative way that allows the frames to be determined at runtime so that the frames’ definitions can take into account the screen size of the device that the application is running on.

The screen size for each device is listed in Table 15.1. (Remember that points are used ...

Get iOS Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

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