

This is why I want to teach you auto layout at the very beginning of this book, rather than jumping right into coding a real app. Without using auto layout, it would be very hard for you to create an app that supports all screen resolutions. If your app is going to support both iPhone and iPad (also known as a universal app), you will need to make sure the app fits additional screen sizes including 7.9-inch, 9.7-inch, 10.5-inch, and 12.9-inch.

When you design your app UI, you have to cater for all these screen sizes. Now Apple’s iPhones are available in different screen sizes including 3.5-inch, 4-inch, 4.7-inch, 5.5-inch and 5.8-inch displays. In September 2014, Apple introduced the iPhone 6 and 6 Plus. When iPhone was first released over ten years ago, it only came with a single screen size: 3.5-inch.

But believe me, you won’t be able to live without it when developing an app today. It allows developers to create an adaptive UI that responds appropriately to changes in screen size and device orientation. This tutorial was updated on 9 Jun, 2019 for Xcode 10.2.Īuto layout is a constraint-based layout system.
