O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

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

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 ...

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