Learn the solution to the peanut butter challenge.
- [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 give myself a little space here…
- When and why to use Auto Layout programmatically
- Creating constraints in Swift
- Resolving errors in Auto Layout
- Using the safe area
- Working with the Visual Format Language
- Adding a stack view
- Harnessing the power of inequalities and priorities in constraints
- Understanding traits and size classes
Skill Level Intermediate
Learning LayoutTest for iOS Developmentwith Kyle Sherman1h 43m Intermediate
Designing iOS and Android Appswith Renata Phillippi1h 6m Intermediate
1. Basic Concepts in Auto Layout
2. Coding Constraints
3. The Visual Format Language
4. Stack Views
5. Advanced Layout
6. Size Classes
Next steps1m 42s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.