For the More Curious: NSAutoresizingMaskLayoutConstraint

As we mentioned earlier, before Auto Layout iOS applications used another system for managing layout: autoresizing masks. Each view had an autoresizing mask that constrained its relationship with its superview, but this mask could not affect relationships between sibling views.

By default, views create and add constraints based on their autoresizing masks. However, these translated constraints often conflict with the explicit constraints in your layout, which results in an unsatisfiable constraints problem.

To see this happen, comment out the line in loadView() that turns off the translation of autoresizing masks.

// segmentedControl.translatesAutoresizingMaskIntoConstraints ...

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