0Pricing
SwiftUI Academy · Lesson

Custom Alignment Guides

Align views across the hierarchy precisely.

Lining Things Up

Stacks align children using a shared edge or center. Alignment guides let you fine-tune exactly where that line falls. 📏

Built-in Alignments

An HStack takes a vertical alignment like .top or .center, while a VStack takes a horizontal one.

HStack(alignment: .top) {
    Text("A")
    Text("Big")
}

All lessons in this course

  1. GeometryReader Essentials
  2. Custom Alignment Guides
  3. The Layout Protocol
  4. Building a Flow Layout
← Back to SwiftUI Academy