O'Reilly logo

iOS Auto Layout Demystified by Erica Sadun

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

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 ...

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