Adding Auto Layout to the Explore screen's section header

If you build and run your app now in the iPhone 11 Simulator, the collection view section header will look great, but if you switch to a simulator with a smaller screen, you'll see some graphic elements have been cut off. As you have seen in previous chapters, Auto Layout ensures that the UI adapts to the device's screen size and orientation. For example, the Let's Eat app logo stays in the exact center of the screen regardless of device, and the table view in the Locations screen takes up all of the available screen space even when the device is rotated.

So far, you've only used Auto Layout with single UI elements. In this section, you will add Auto Layout constraints to multiple ...

Get iOS 13 Programming for Beginners - Fourth 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.