These very good principles have been taken from Udacity course.
Guiding principles
- Stack views first, constrains later
- Start small, or not at all
- Work from the inside out
- Trust the simulator or device only
- Don’t panic
Seven commandments of AutoLayout
- Tweak the properties of the StackView
- Use another StackView
- Tweak the compression resistance or the hugging priority
- Add constraints to the StackView
- Add constraints to the views
- To connect views within different StackViews, use 5
- If everything else fails, use a filler view
Some other useful links:
WWDC 2017
WWDC 2016
WWDC 2015