2. Constraints

With Auto Layout, you build interfaces by declaring rules about views. Each layout rule you add creates a requirement about how part of the interface should be laid out. These rules are ranked based on a numeric priority that you supply to the system, and Auto Layout builds your interface’s visual presentation accordingly.

Auto Layout is essentially a constraint satisfaction system. The word constraint means a limitation or restriction. The rules you build restrict how elements may be placed onscreen. As you read in Chapter 1, “Introducing Auto Layout,” these rules must be sufficient to fully describe the interface and unambiguously satisfiable so that any rules that are in conflict with each other can be resolved by comparing ...

Get iOS Auto Layout Demystified now with O’Reilly online learning.

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