Code the layout for iPad.
- [Narrator] Now that we tagged constraints,…we'll try to find them in the view a layout sub-views.…Go ahead and close the app.…And head up there.…There's several steps we're gonna need to do.…First of all, let's get the constraints back from the view.…So, just under the print statement here,…give yourself a little space, and in the middle…of that space we're gonna type var constraints.…
And we can get the constraints…from a property of the view called constraints.…And this'll give you an array of constraints.…Now, I'm gonna replace the current constraints…with these constraints.…In order to prevent a conflict…from some of these constraints,…we're gonna erase the active ones.…So I'm gonna go ahead and erase them.…To do that, we're gonna use another NS layout constraint…class method, and this one,…instead of activate, we're gonna deactivate.…
Works the same way, you just put the constraint array…in there, and it kills it.…We never know where, in that array, the constraints are.…That's where the identifier comes in.…
- When and why to use Auto Layout programmatically
- Creating constraints in Swift
- Resolving errors in Auto Layout
- Using the safe area
- Working with the Visual Format Language
- Adding a stack view
- Harnessing the power of inequalities and priorities in constraints
- Understanding traits and size classes
Skill Level Intermediate
Learning LayoutTest for iOS Developmentwith Kyle Sherman1h 43m Intermediate
Designing iOS and Android Appswith Renata Phillippi1h 6m Intermediate
1. Basic Concepts in Auto Layout
2. Coding Constraints
3. The Visual Format Language
4. Stack Views
5. Advanced Layout
6. Size Classes
Next steps1m 42s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.