O'Reilly logo

Xcode 7 Essentials - Second Edition by Jayant Varma, Brett Ohland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Stack views

As we learned in Chapter 4, Interface Builder, Auto Layout stops us from thinking about object positions in terms of grids and instead has us thinking about relationships. The problem with user interfaces is that a simple layout can actually hide a fair amount of complexity. When this happens, using Auto Layout can be very tedious.

Let's say you'd like to create a sign up form for your application. The form has several input boxes and a sign up button. Ideally, you'd like to group some of the input boxes to make things easier on the user.

This is what your layout would look like using plain Auto Layout within a view:

Stack views

24 constraints need ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required