Add Visual Format Language to subviews

- [Instructor] We got out button view…on to the label view as visual layout language.…I'll get a head start because I actually have some code…that's already written over here in layout views.…Remember that equal margin stuff from the stack view…so I've got some of this already written…and I can copy that, move it up…to add label view and stick it inside…where the constraints are.…And then I can start modifying this.…

First thing I wanna modify is the views themselves…'cause we're gonna have new views.…And so the first one, let's just delete all that…so that we don't have all this junk in the way,…and quote quote label, and that's gonna be the label.…And quote quote and image view, and that's the image view.…

Next I'm gonna add metrics…which I didn't have in the original one here,…and that'll be typed out as string any…and I'll leave a blank metric for now but we're gonna get…to it in a little bit.…And then I'm gonna copy this constraint here…and duplicate it with copy paste.…

And now I'm gonna go fix my constraints here.…

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.