Solution: Pasta

(tinkling) (electronic whirring)…- [Instructor] As you look for a solution,…let's first look at the constraints…I'm supposed to be working with.…So I'm gonna stop the app, get rid of the console,…head over to PastaView Controller,…and let's take a look at what we got here.…Then a layout.…This time everything is in layout,…so it's nice and easier.…And here are my priorities for views,…and there's the constraints.…So I have a whole bunch of constraints here.…

And I do have a little bit of visual format here.…So, I'm gonna be using both of them.…If you look at the H and the V constraint,…I'm horizontally constraining the image view,…then vertically constraining the image view…label and order button with an alignment of leading.…The back button is missing here.…If I scroll down, the back button…is a coded constraint aligned to the top…and bottom of the order button,…and aligned to the trailing edge of the image view.…

Now, doing things like this can get…really confusing, so try to avoid 'em.…But this gives me more scenarios…

Resume Transcript Auto-Scroll

Author

Released

6/5/2018

Auto Layout offers a constraint-based design approach that allows iOS developers to create user interfaces for multiple devices. If you're using Swift Playgrounds or need portable and modular code, programmatic Auto Layout is your prime choice. In this course, instructor Steven Lipton talks about the different options you have to create constraints programmatically in Swift—and how to use each one. He also shows how to use size classes, stack views, and priorities for the fastest, most adaptable UI on any iOS device.