~/talk

State Driven Development - The Beauty of Enums in Swift

Talkat UIKonf 2020 · 2020-05-17..05-20· [swift]
speakerdeck:cnstoll
slides:none on file

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

  1. 0:00Introduction to talk
  2. 1:11Problems with mutable state
  3. 5:24Introducing state enums
  4. 8:36Extending enums for behavior
  5. 14:11Associated values in enums
  6. 18:50Enums as single source of truth
  7. 21:00CaseIterable and raw values
  8. 24:14Real-world enum example
  9. 25:09Summary and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.