25 Auto Layout

Have you tried resizing the RaiseMan window? The table view and buttons are steadfast in the face of your pointer. While their confidence is inspiring, as a user you want the window and its contents to match your needs. As a developer you want to build an app whose interface gracefully responds to resizing, accommodating the smallest and the largest of layouts without looking, well, broken.

As you learned in Chapter 17, views are positioned by their frame, which sets the view’s position within its superview. By default, when you place a view in Xcode, the view’s frame is static.

You could change your application’s layout dynamically by observing window resizing notifications and programmatically reposition your ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.