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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.