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.
Solution: Cake - iOS Tutorial
From the course: iOS Development: Auto Layout Programmatically
Solution: Cake
(soft music) (whooshing) - [Instructor] Okay, there's a lot of solutions for this particular case, but the simplest thing, and I want to show you how to do it on the simplest version, is our goal is to take whatever is holding this leading edge to the label to make it a trailing edge of the label. That's our goal. Go ahead and stop the app, close everything up, move over to CakeViewController. You can even get rid of navigation for now so that we have plenty of room. Head down to viewWillLayoutSubviews. You see I've already got a lot of this code already in place, so you're in good shape there. Just like we just did. Now, scroll on down a little further. Almost all of our constraints are the same as what we just did. We just have to find one that will do what we need it to do and it just so happens to be right here. Is the orderButton.leading is equal to the label.leading? This is the constraint I gotta work with. What I'm gonna do with this is very simple. Let's make a space. I'm…
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
-
-