~/talk

Encoding and Decoding in Swift

Talkat try! Swift NYC 2019 · 2019-09-09..09-10· [swift]

Explains how Swift’s Codable actually works with concrete code: shows the Encoder vs JSONEncoder API mismatch, walks through nested keyed and unkeyed containers and single-value containers, demonstrates renaming keys, flattening arrays into strings, and custom encode/decode implementations, and describes building a custom encoder/decoder for MongoDB including the private _JSONEncoder/_JSONEncodingStorage-backed NS arrays/dictionaries approach. Covers practical limits — performance and boilerplate — and gives concrete examples that compile and round‑trip JSON.

AI-written summary · about

  1. 0:00Start
  2. 1:05What Encoding and Decoding Actually Are
  3. 1:38Decoding
  4. 4:19Format Agnostic
  5. 4:36Decodable Protocol
  6. 5:58Json Encoder
  7. 7:04Json Decoder
  8. 8:11Rename a Key
  9. 8:33Coding Keys
  10. 8:59Custom Implementation
  11. 10:12The Encoder Protocol
  12. 11:33Recursive Case
  13. 12:36Keyed Container
  14. 15:20Nested Container
  15. 16:42Array Implementation of the Encode Method
  16. 18:15Flattening Data
  17. 19:08Encode Method
  18. 21:05Main Takeaways
  19. 21:32Writing Your Own Encoders and Decoders
  20. 23:17Json Encoding Storage
  21. 25:52Limitations
~/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.