The Laws of Constraints

Although you can think of constraints as hard “math,” they’re actually just preferences. iOS finds a layout solution that best matches your constraints; this solution may not always be unique. Here are a few basic facts about constraints:

Image Constraints are relationships, not directional. You don’t have to solve the right side to calculate the left side.

Image Constraints have priorities. Priorities range numerically from 0 to 1,000. The Auto Layout system uses priorities to sort constraints. Higher priorities are always satisfied ...

Get The Core iOS Developer’s Cookbook, Fifth Edition 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.