Be sure to check out these videos on AutoLayout:
There's some stuff in there that you may already know, but they also explain new stuff. My highlights:
- First use stackviews, then for the rest, use constraints
- Don't add and remove constraints, activate and deactivate them
- For text, you might want to use firstBaseline and lastBaseline
- Use "alignment rects" if you need to ignore extra stuff in your views (like shadows)
And in part 2:
- Use the .identifier property on views when debugging, it's a string that'll show up in the log
- Use method in the debugger called constraintsForAxis or something
- There's a trace method in the debugger: po [self.view _autolayoutTrace] (can show ambiguous layouts); then on the LLDB prompt: po [object exerciseAmbiguityLayout]
- While your app is running, check the menu Debug, option View Debugging