State Driven Development - The Beauty of Enums in Swift
summary
Argues that replacing multiple booleans with Swift enums prevents invalid combinations — three booleans produce eight possible states even though only four valid states exist — and shows concrete code: lifecycle enum for a workout app used by MyFitnessPal/MapMyRun, enum extensions that answer questions like canStartWorkout, associated values to carry the active Workout, caseIterable/rawRepresentable for iteration and keys, and a confetti hackathon feature that works in the app.
AI-written summary · about
chapters (9)
- 0:00Introduction to talk
- 1:11Problems with mutable state
- 5:24Introducing state enums
- 8:36Extending enums for behavior
- 14:11Associated values in enums
- 18:50Enums as single source of truth
- 21:00CaseIterable and raw values
- 24:14Real-world enum example
- 25:09Summary and closing








