The SwiftUI fundamentals you actually need
A focused tour of the five SwiftUI concepts that cover most real screens, so you can read and correct AI-generated views.
You don't need to master SwiftUI to ship DayOne. You need five ideas well enough to read generated code and know where to poke when it's wrong. Here they are.
1. Views are values, composed from smaller views
A View describes a piece of UI. You build big screens by nesting small views inside layout containers: VStack (vertical), HStack (horizontal), ZStack (layered), and List (a scrolling table). Everything is composition.
2. Modifiers change how a view looks or behaves
Text("DayOne")
.font(.largeTitle) // modifier: sets the font
.bold() // modifier: makes it bold
.padding() // modifier: adds space around itEach .something() returns a new, modified view. Order matters — .padding().background(.blue) colors the padding, while .background(.blue).padding() does not. When AI-generated spacing looks wrong, a swapped modifier order is a common cause.
3. State drives the UI
@State holds a value the view owns. When it changes, SwiftUI redraws. @Binding is a two-way reference to someone else's state (that's the $ you see). For SwiftData, @Query fetches your saved objects and keeps the view in sync automatically.
@State private var draft = "" // this view owns it
TextField("Write…", text: $draft) // $ passes a binding so the field can edit it4. Navigation moves between screens
A NavigationStack wraps your app and lets a NavigationLink push a new screen on tap. A .sheet presents a screen modally (sliding up from the bottom) — perfect for the "new entry" editor.
5. Lists render collections
List(entries) { entry in
Text(entry.body)
}Stacks, modifiers, state/bindings, navigation, and lists cover the vast majority of screens you'll build. When the AI hands you 80 lines, you'll now recognize the skeleton — and that's what lets you steer instead of guess.