Learn the notation used on comments and storyboards for describing constraints.
- [Instructor] In the challenge, you wrote down…all those constraints graphically.…Apple documentation and Xcode has its own notation…for writing them down.…Since you'll see it around, and they make it easier…to describe things in comments, let's discuss this notation.…Apple uses algebra to describe Auto Layout constraints…in the form of a linear equation.…So we have view1.attribute equals view2 did attribute…times a multiplier plus a constant.…I haven't talked about the multiplier yet,…so we're gonna ignore it,…and assume it is always one for now.…
That changes the equation,…since one really doesn't do anything to this.…You equate the view you're placing as V1,…and the reference as V2.…The space between them is constant.…For example, let's use some solutions from the challenge.…Pinning the image view to the top of the view…is label.top equals view.top plus 20.…My attributes are those edges that I had earlier.…
Now, I'm gonna be using all this as comments…as I write constraints.…So, I'm gonna add the slash marks for all the rest of these.…
- 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.