From the course: iOS Development: Auto Layout Programmatically
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Dynamic trait changes on iPad (continued) - iOS Tutorial
From the course: iOS Development: Auto Layout Programmatically
Dynamic trait changes on iPad (continued)
- [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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
Why use size classes?2m 51s
-
(Locked)
Trait collections6m 26s
-
(Locked)
Determine the size class7m 51s
-
(Locked)
Dynamic trait changes on iPhone4m 24s
-
(Locked)
Dynamic trait changes on iPad4m
-
(Locked)
Dynamic trait changes on iPad (continued)5m 44s
-
(Locked)
Challenge: Cake29s
-
(Locked)
Solution: Cake9m 35s
-
-