O'Reilly logo

iOS Auto Layout Demystified, Second Edition 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

Auto Layout is a constraint satisfaction system. The word constraint means “limitation” or “restriction.” Each rule you build creates a requirement about how one part of the interface relates with another. You rank these rules using a numeric priority, and Auto Layout builds your interface’s visual presentation based on your rules and ranking. In this chapter, you will read about constraints in depth—what they are and how to specify them. You will learn about the kinds of constraints used in Auto Layout, how to install constraints in the system, and how priorities affect your results.

Constraint Types

Auto Layout centers on several core constraint classes:

Layout constraints (NSLayoutConstraint class, public)—These rules specify ...

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