0Pricing
Swift Academy · Lesson

VStack, HStack and ZStack Fundamentals

Stacking views vertically, horizontally and depth-wise with spacing and alignment.

Welcome

`VStack`, `HStack`, and `ZStack` are the three fundamental layout containers in SwiftUI. Understanding them is essential for building any interface.

VStack — Vertical

```swift VStack(alignment: .leading, spacing: 8) { Text("Title").font(.title) Text("Subtitle").foregroundColor(.secondary) Button("Action") {} } ```

All lessons in this course

  1. VStack, HStack and ZStack Fundamentals
  2. LazyVGrid and LazyHGrid
  3. Spacer, Padding and Frame Modifiers
  4. GeometryReader for Adaptive Layouts
← Back to Swift Academy