Size Classes

Often, you want an application’s interface to have a different layout depending on the dimensions and orientation of the screen. In this chapter, you will modify the interface for DetailViewController so that when it appears on a screen that has a relatively small height, the set of text fields and the image view are side by side instead of stacked (Figure 16.1).

Figure 16.1  Two layouts for DetailViewController

Two layouts for DetailViewController

The relative sizes of screens are defined in size classes. A size class represents a relative amount of screen space in a given dimension. Each dimension (width and height) is classified as either compact ...

Get iOS Programming: The Big Nerd Ranch Guide, 7th Edition 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.