~/talk

Enumerating The Reasons

Talkat 360iDev 2018 · 2018-08-26..08-29· [swift]
speakerdeck:cnstoll
slides:none on file

Argues that replacing tangled booleans with a single enum makes invalid states impossible and reduces bugs, demonstrates using Xcode regex to find many bools, constructs a four lifecycle states enum that replaces three separate BOOL flags, shows Swift features: associated values and protocol conformance, CaseIterable and RawRepresentable, moves UI logic into enum methods, and builds a working confetti feature for MyFitnessPal/MapMyRun as a real example to prove the approach scales and simplifies state-driven code.

AI-written summary · about

  1. 0:00Start
  2. 1:42State Driven Development
  3. 2:01var instanceVariable : Bool
  4. 3:36Example
  5. 4:32func startworkout() return
  6. 7:26Perfect case for an enum
  7. 8:02Enums make invalid states impossible to represent!
  8. 9:19Extending enums with variables and functions
  9. 15:32Associated Values
  10. 18:51case workout InProgress(current: Workout) var navigationTitle : String
  11. 19:26Table View Cell Configurations
  12. 21:47View Controller Modes Viewing, Editing, New
  13. 23:16Workout Activity Types Running, Cycling, Swimming
  14. 25:40Confetti Moments Colors, Images
  15. 30:24Associated vs. Raw Values
  16. 33:23Enums and Optionals - Writing Self Documenting Swift Code Code Encapsulation in Swift Enumerations
~/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.