~/talk

Journey Of Codable

Talkat Swift India Conference 2019 · on Sunday, 2019-07-28· [swift]
slides:none on file

Codable (Swift 4) provides compiler-synthesized encode/decode for structs and enums, lets JSONDecoder use strategies like convertFromSnakeCase, and supports custom key handling via a custom CodingKey struct for kebab keys and nested arrays. Examples show custom converters that coerce strings to Int/Bool, a hand-rolled XML decoder of ~900 lines, Combine-friendly top-level decoder support (Xcode 11 beta 4), and guidance that JSONDecoder performs well for hundreds–thousands of records but degrades at tens of thousands or millions.

AI-written summary · about

  1. 0:00Introduction to Codable
  2. 1:48Why Codable was introduced
  3. 3:16Default Codable synthesis
  4. 5:25Understanding Encoders and Decoders
  5. 6:51Basic Codable example
  6. 7:55Custom key strategies
  7. 9:01Handling kebab-case keys
  8. 12:42Nested containers in Codable
  9. 14:06Type mismatch handling
  10. 17:21Closed range support
  11. 19:11Custom encoders and decoders
  12. 20:17Combine integration
  13. 21:20Performance considerations
  14. 22:05Advantages over NSKeyedArchiver
  15. 23:11Closing remarks and thanks
~/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.