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)

Dynamic trait changes on iPad (continued) - iOS Tutorial

From the course: iOS Development: Auto Layout Programmatically

Start my 1-month free trial

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…

Contents