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








