14.4.4 Adding the Auto Layout Constraints

You’ve now completed the Tip Calculator app’s UI design, but have not yet added any auto layout constraints. If you run the app in the simulator or on a device, however, you’ll notice that—depending on which simulator you use—some of the UI components extend beyond the trailing edge (Fig. 14.22). In this section, you’ll add auto layout constraints so that the UI components can adjust to display properly on devices of various sizes and resolutions.

Image

Fig. 14.22 | App in the iPhone 5s simulator without auto layout constraints added to the UI—some components flow off the trailing edge (the right side in this ...

Get Swift™ for Programmers now with O’Reilly online learning.

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