O'Reilly logo

iOS Auto Layout Demystified, Second Edition by Erica Sadun

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

4. Visual Formats

Auto Layout builds constraints in three ways. So far, you’ve read about two of them. First, you can lay out your constraints in Interface Builder (IB) and customize them to your needs. Second, you can build single constraints in code. The NSLayoutConstraint class offers the constraintWithItem: attribute:relatedBy:toItem:attribute:multiplier:constant: method, which enables you to create constraints one at a time, relating one item’s attribute to another. In this chapter, you’ll read about the third way: using a visual formatting language to express how items are laid out along vertical and horizontal axes.

This chapter explores what these visual constraints look like, how you build them, and how you use them in your projects. ...

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