Parsing JSON that contains multiple different types of objects in Swift

preview_player
Показать описание
Recently I had to parse a JSON response that contains a multiple different types of objects. At first it looks like a very simple task. My initial idea was to just add more optional properties to cover all of the required types. But it turns out that using the Swift enum types with associated values is a much cleaner and better way to handle it. In this video you can see the sample JSON and my proposed solution.

#iOS #Swift #programming #xcode #apple

Music: Streambeats
Рекомендации по теме
Комментарии
Автор

Nice video man. 
I remember that recently used optionals for Atlassian API. Time to refactor I guess.

xushnudkeldiboyev