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 views in Interface Builder (IB), where IB automatically adds constraints and you 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. This call creates constraints one at a time, relating one item’s attribute to another. In this chapter, you read about the third way. A rather nifty visual formatting language enables you to express how items are laid out along vertical and horizontal axes.
This chapter explores what these visual constraints look like, how you build ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access