Learn some critical steps to do before adding layout constraints.
- [Instructor] With some basic concepts behind you,…you're ready to code.…There's several ways to code constraints…and I'll start with the most basic.…Adding individual constraints, while very tedious…and lengthy in code is the most precise…with little guessing from auto layout.…Your first step is one of the most important ones…to avoid conflicting constraint errors.…Xcode by default figures out some constraints for your views…even if you don't.…Before you use Auto Layout…you must turn this default off for each subview.…
You set that view's property translates auto resizing mask…into constraints to false.…If the app is still running, hit command right arrow…to rotate back to portrait and then close it.…In xcode close the console and head over…to the FrenchToastViewController.…Find the layoutViews method.…So let's go ahead and shut down…translate auto sizing mask into constraints…for adding the constraints like this.…
And I'll do it for the label under the mark…by typing in label, for the label just under…where it says MARK: Label Layout.…
- 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.