Learn to detect size classes for views and view controllers using UITraitCollection.
- [Instructor] Now how do you figure out…what the size classes are programmatically?…For that, you need something called a trait collection.…And let's go take a look at the trait collection.…Go ahead and stop the app,…and I'm gonna go over here to the HotFudgeViewController…and you'll find in here a sizeClassString that I added here.…And here we have the three different types…of size classes that exist.…The two that we've already talked about…is the compact, which has to do usually with iPhones,…and regular, which almost always has to deal with iPads…until you get into multi-pane stuff.…
And the one on top here is unspecified.…Now, unspecified happens when you add views…that haven't actually had any information…about the device added to them.…So, it's usually when you're adding views.…90% of the time we're not gonna get into that,…because what happens is once you add it to a hierarchy,…it often will take that with it,…and the cases where it won't…is beyond the scope of this course.…So the two we're really gonna worry about…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.