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

Solution: Peanut butter - iOS Tutorial

From the course: iOS Development: Auto Layout Programmatically

Start my 1-month free trial

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…

Contents