Chapter 7. More adaptive layout

This chapter covers

  • Adapting layouts for size classes
  • Adapting layouts with stack views

In this chapter, we’ll look at a useful feature for manipulating layouts in different environments, called size classes. We’ll use size classes to adjust layouts programmatically and from within Interface Builder.

We’ll then explore stack views—a feature introduced in iOS 9 that speeds up the process of setting up an adaptive layout (in most cases).

7.1. Size classes

Auto layout is great for adjusting a layout based on constraints, but sometimes a layout requires more-significant adjustments based on the device type, screen size, or orientation.

For example, you may want

  • A bigger font size in the huge iPad Pro screen ...

Get iOS Development with Swift 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.