The Auto Layout System

Before you can fix the labels to have them lay out flexibly, you need to learn a little theory about the Auto Layout system.

As you saw in Chapter 1, absolute coordinates 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 enables their 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.

Alignment rectangle and layout attributes

The Auto Layout system is based on the alignment rectangle. This rectangle is defined by several layout attributes (Figure 3.16).

Figure ...

Get iOS Programming: The Big Nerd Ranch Guide 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.