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: Peanut butter - iOS Tutorial
From the course: iOS Development: Auto Layout Programmatically
Solution: Peanut butter
- [Narrator] There's plenty of solutions to this challenge if you start from scratch. Heres one if you didn't copy and paste the hamburger. I'll start over in the hamburger and first I gotta stop my app. Close everything up. Then I'm gonna copy and paste all of layout views just to save me some time. Head over to peanut butter. Go to layout views. And this is nice and blank and so what I can do is paste right on top of it. And that'll save me a lot of the extra work of doing the translate, auto resizing and all that stuff. Now, if you look to the challenge carefully, you'll see that there's really two numbers that are floating around a lot. And I'm gonna make both of those as constants. One of which we already have is margin space and the margin space was gonna be 10. And if you'll also look, there was padding and the padding was gonna be 20. So, I'm gonna make another constant here of CGFloat of 20 points. Now, I'll set margins first here. I already got two of them done. I'm gonna…
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
-
-
-
-
-
(Locked)
Prepare for the Visual Format Language7m 14s
-
(Locked)
Visual Format basics5m 28s
-
Visual Format pin constants4m 48s
-
(Locked)
Alignment and multiple constraints6m 50s
-
(Locked)
Use sizes with Visual Format8m 40s
-
(Locked)
Metrics, margins, and anchors6m 10s
-
(Locked)
Errors in Visual Format5m 31s
-
(Locked)
Challenge: Peanut butter55s
-
(Locked)
Solution: Peanut butter10m 9s
-
(Locked)
-
-
-
-