NEW: Start my new Ultimate Portfolio App course with a free Hacking with Swift+ trial! >>

DAY 31

Project 6, part two

One of the three laws laid down by British science fiction writer Arthur C. Clarke is particularly well known: “any sufficiently advanced technology is indistinguishable from magic.”

It’s possible that you’re thinking Auto Layout is a bit of a black box, where magic happens to make sure all your rules are followed. But it isn’t: Auto Layout is actually straightforward most of the time, and as long as you make sure your constraints are a) complete, and b) non-contradictory, you shouldn’t have too many problems.

Today you have three topics to work through, and you’ll learn about advanced Visual Formatting Language and Auto Layout anchors. Once you’re done, please complete the project review then work through all three of its challenges.

If you’re keen to learn more about Auto Layout, I have an Auto Layout cheat sheet that gives you lots of example code to solve common problems.

If you’re feeling mathematically brave, there’s also a great talk by Agnes Vasarhelyi that goes into exactly how the Auto Layout algorithm works behind the scenes – it should prove there’s no magic once and for all!

Need help? Tweet me @twostraws!


Hacking with Swift is sponsored by Instabug

SPONSORED Catch bugs as soon as they happen and know exactly why a crash occurred. Instabug's SDK grabs all the logs they need to fix bugs, crashes and performance issues in minutes instead of days. Get screenshots, device details, network logs, repro steps, and tons of other critical insights needed to resolve issues and prioritize product backlogs straight from your dashboard. It only takes a minute to integrate!

Get started now

Sponsor Hacking with Swift and reach the world's largest Swift community!

100 Days of Swift

The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.

Back to 100 Days of Swift

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.