Join Steven Lipton for an in-depth discussion in this video Dynamic trait changes on iPad (continued), part of iOS Development: Auto Layout Programmatically.
- [Instructor] Now that we can identify the constraints,…we're gonna go ahead and change them.…I'm actually gonna go to Dynamic Constraints here,…and I'm gonna copy this to start.…And then I'm gonna put them somewhere…where you may not totally expect me to start.…And that's actually here in Portrait.…Now why I'm starting in Portrait is this.…I'm eventually gonna have to come back to this state…when I go to Portrait.…So these are already written.…
I'm gonna start getting these modified…to the way that they need to be set up,…and then I'll copy those,…and then change the constraints for landscape.…Okay, so here's what we're gonna do.…Instead of let pin,…I'm gonna change that to constraints…with the index that we have.…And again, that's gotta be explicitly unwrapped.…
Now I'm gonna do the same thing down here,…and instead of using pin,…I'm gonna use constraints just like I used up above.…constraints[pinIndex!], unwrap it.…I need to do this step,…because again, this is an init.…So that's gonna erase my identifier that I had earlier.…
- 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.