Skip to content

Latest commit

 

History

History
 
 

10-Project6b

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Project 6b - Auto Layout

https://www.hackingwithswift.com/read/6/3/auto-layout-in-code-addconstraints-with-visual-format-language

Includes solutions to the challenges.

Topics

Auto Layout, Constraints, Visual Format Language

Challenges

From Hacking with Swift:

  1. Try replacing the widthAnchor of our labels with leadingAnchor and trailingAnchor constraints, which more explicitly pin the label to the edges of its parent.
  2. Once you’ve completed the first challenge, try using the safeAreaLayoutGuide for those constraints. You can see if this is working by rotating to landscape, because the labels won’t go under the safe area.
  3. Try making the height of your labels equal to 1/5th of the main view, minus 10 for the spacing. This is a hard one, but I’ve included hints below!

Screenshots

screenshot1 screenshot1