100 Days of SwiftUI Day 92

100 Days of SwiftUI – Day 92

We’ve arrived at day 92 of the 100 Days of SwiftUI! After finishing Flashzilla, we’ll be starting the final technique project of the course today and we’ll be looking at how SwiftUI handles layouts and geometry. Let’s dive in!

Layout and geometry introductions

In this technique project we’re going to explore how SwiftUI handles layout. Some of these things have been explained a little already, some of them you might have figured out yourself, but many more are things you might just have taken for granted to this point, so I hope a detailed exploration will really shed some light on how SwiftUI works.

Hacking with Swift, Paul Hudson (@twostraws)

How layout works in SwiftUI

A view happens in three simple steps, with a fourth step being performed behind the scenes. There are actually quite a few things to take note off, so be sure to go over Paul’s article and video on how layouts work.

Alignment and alignment guides

SwiftUI features multiple ways for us to align views. The simplest alignment option is to use the alignment parameter of a frame() modifier. This is something we’ve seen and used ourselves multiple times before. As for our other options, these are explained as well of course.

Wrap up

And that’s it for day 92 and the first day of our final technique project. We’ll continue tomorrow as we’ll look at absolute positioning and more theory about the GeometryReader. Stay tuned for that!

Darryl

Hi! My name is Darryl and this is my personal blog where I write about my journey as I learn programming! You'll also find articles about other things that interest me including games, tech and anime.

Post navigation

Leave a Comment

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

100 Days of SwiftUI – Day 41

100 Days of SwiftUI – Day 17 – WeSplit

100 Days of SwiftUI – Day 87

100 Days of SwiftUI – Day 57