Group Group Group Group Group Group Group Group Group Forums

Auto Layout Tutorial in iOS 9 Part 2: Constraints

Learn the basics of auto layout including resolving layout conflicts in part 2 of this auto layout tutorial, fully up-to-date with iOS 9.

This is a companion discussion topic for the original entry at

Actually for the Gallery example, one can still use Size classes, because we can just build views and make the width half the superview’s width, and let the 2* height = superview.height - stausbarheight, we can add these constraints, I tried, one can make the Gallery work on different size of iPads/iPhones.

Brad, Thank you very much for the most excellent tutorial! I have gone from utterly confused to I can deal with Auto Layouts now.

can you suggest common layout for both iPhone & iPad.

Very good tutorial : )
I liked how you went from one problem + solution (easiest one) to another pair of problem + solution (to complicated one)!

Is there a tutorial on how to apply auto layout constraints in code? I need to set constraints for a WKWebView which I can’t do in Interface Builder.