← All lessonsThe guides
Guides

The guides, in full

Nine single pages that go all the way into one subject. Each collects what the course says about it, from every lesson that touches it, and goes further than any one lesson can.

6248003032315232163256
Guide · The attribute graph

Inside the Attribute Graph

What a view becomes once SwiftUI has it: a handful of numbered nodes, edges made by reads, and one zero-byte node per @State — every number on these pages read out of a running app

8 pages: the code beside its graph, a debugger you tap through, and every number taken from AttributeGraph's own dump.

Open the guide →

piece 1awaitthe answerpiece 2
Guide · await

await, in full

What one await does to a function, how a loop with an await in it is built, what waiting really is, how for await and AsyncStream are made of those, and what an await does to an actor — each with a program that compiles and runs

9 sections, each built on the one before: one await cut into two functions, a loop with an await in it, the machine code, a continuation parking a task, for await as the compiler writes it, a stream by hand and then AsyncStream, a cancelled task, and await on an actor — the main one, one of your own, and one with a queue of its own.

Open the guide →

Bindinggetsetone value, somewhere else
Guide · Bindings

Binding, @Binding and @Bindable

From one Binding you make by hand, up to the two property wrappers that write it for you, with a small implementation of each that compiles and runs

9 sections, each adding one thing to the last: a Binding made by hand, a small implementation of it, @Binding, a Binding to part of a value, and @Bindable, all compiled and run, and then what the real ones add.

Open the guide →

id 1id 2id 3
Guide · ForEach

ForEach, in full

What it keeps, when it makes its rows, and how it tells them apart — the loop SwiftUI has instead of a for

6 sections, run on the simulator: a thousand-row List, and a list identified by position and by name.

Open the guide →

body.property{ 3176 }read, then told
Guide · @Observable

@Observable, in full

How one plain read in a body registers the view to be told when the property changes — the list on the thread, observableObject's registrar, and the closure that holds the view's node — with a model of the whole path that compiles and runs

10 sections: what an observable is, the question, its answer as a sequence diagram, a model of the path with Apple's type names, compiled and run — and Observations, the loop built on the same path, written small and run beside the real one.

Open the guide →

modelclosureeach holds the other
Guide · Retain cycles

Retain cycles in SwiftUI

When an @Observable model is never freed, and when it is. A SwiftUI view is a struct whose body is a getter, and SwiftUI keeps the closures it writes, so a screen that only names its model never traps it; the model it owns can, through a closure it stores, a task or timer that never ends, or a reference that leads back. Every case is run — the screens in a real window, shown and popped — and shown freed or still alive

7 sections: the one rule and why the screen is exempt, a model that holds a closure, a task or timer that never ends, cycles with no closure of yours, weak against unowned and deinit, how to find one, and a project of twelve leaks to open.

Open the guide →