Codable and Polymorphism

Episode #305 | 19 minutes | published on October 9, 2017 | Uses xcode-9.0, swift-4
Subscribers Only
Codable is a great API, but sometimes real APIs can be tricky to model. In this episode we’ll examine a real use case of an API that returns a collection of elements, each of them similar but specified by a type. We’ll leverage Codable and inheritance to create a representation of this structure and show how you can peek into the container in order to determine what type to decode.

Episode Links

blog comments powered by Disqus