DevPrep

All topics › Auto Layout

How do you debug Auto Layout: conflict logs, View Debugger and identifier?

Middle PRO

The gist

Debugging Auto Layout comes down to three questions: which constraints conflict, where they came from, and what is missing. The answers come from the Unable to simultaneously satisfy constraints log, a symbolic breakpoint, the View Debugger in Xcode and a few debugging methods on UIView. The clearer the names of constraints and views, the faster the log reads.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store