~/talk

Swift 4 Codable

Talkat try! Swift NYC 2017 · 2017-09-05..09-06· [swift]
slides:none on file

Swift 4 Codable maps JSON to Swift structs with auto-synthesized CodingKeys and generated init(from:) / encode(to:), letting JSONDecoder/JSONEncoder parse a multiline JSON string into a struct in one line. It supports primitives, Optionals, Array/Dictionary and CoreGraphics types, and uses Keyed/Unkeyed/SingleValue containers under the hood. Custom keys (snake_case → camelCase), value validation (reject ints outside 0–200), and learning that synthesis is done by compiler helper functions are demonstrated; enum-based container ideas are blocked by current generics.

AI-written summary · about

  1. 0:00Start
  2. 2:24Codable Example
  3. 2:48Conform to protocol Codable
  4. 3:08Use decoder & encoder
  5. 4:50Auto-synthesis example
  6. 12:40Overview of Codable (1)
  7. 16:101. Requires type variable as argument
  8. 17:122. Can container be enum?
  9. 19:11Recap
~/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.