Cocoa Programming for OS X: The Big Nerd Ranch Guide
by Aaron Hillegass, Adam Preble, Nate Chandler
For the More Curious: Autoresizing Masks
Before Auto Layout, Cocoa developers used autoresizing masks to handle dynamic layout. An autoresizing mask defines how a view resizes in response to its superview resizing. Unlike Auto Layout, autoresizing masks do not provide any means of defining a view’s relationship with its sibling views, changing content as with the intrinsic content size, or animating changes.
An autoresizing mask is made up of springs and struts. Springs allow the view to resize in the horizontal and/or vertical directions. Struts preserve the distance between the sides of the view and its superview. It is called a mask because it is expressed as a bit field. Figure 25.16 and Figure 25.17 demonstrate two typical ...
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