Mastering Auto Layout
May 17 2018 · Video Course (1 hr, 6 mins) · Intermediate
Dive a little deeper into auto layout. Learn more about creating complex constraints and creating universal layouts for all devices.
5/5Version
- Swift 4, iOS 12, Xcode 10
Constraints
Join us for a tour of the Auto Layout features that will allow you to create universal layouts that work great on all devices.
1Sometimes you'll want a property to be constrained not equal to another, but greater than or equal or to it, or less than!
2Satisfy ambiguous or conflicting constraints by defining priorities for them, to match your intended design.
3Create an Auto Layout-based treasure map using scroll views, combined with what else you've learned in this course.
4UILayoutGuide
3:57Instead of using empty views to control the spacing of views, when you're not using Stack Views, you can use UILayoutGuides!
5NSLayoutAnchor
6:27Layout anchors are used for creating constraints on views, in code. They also work on layout guides!
6Use your Auto Layout coding skills along with your knowledge of Stack Views in order to simplify your layout code.
7The Visual Format Language allows you to create many Auto Layout constraints, without requiring many lines of code.
8Create the constraints necessary to achieve a simple three-view layout using the Visual Format Language.
9Conclusion
0:23You're well on your way to mastering constraints. It's time to begin doing the same for adaptive layout!
10Adaptive Layout
Introduction
1:02Adaptive layout is about dealing with different screen sizes, but it's also a lot more than that! Let's learn how deep this water is!
11Size Classes
3:42Use size classes to create universal layouts: ones that take advantage of the smallest iPhone to the largest iPad!
12Create an adaptive layout, combining your new knowledge of size classes with what you know about constraints.
13Views and constraints aren't the only things you might want to vary by size class. Learn how to adjust fonts, images, and more.
14Use the techniques learned in the last video to add a layout variation to two buttons based on environment width.
15Learn about the types and protocols that form the basis for adaptive layout in iOS, for greater control in code.
16View controllers can adapt how they are presented based on the adaptive environment. Learn what the framework does for you and how to modify default behavior.
17Conclusion
1:44Let's have a recap of what you’ve learned in this course. Soon you'll be telling your own Auto Layout tales!
18
Comments