In our last Working with JSON series (Part 1, Part 2 and Part 3), we explore various items: Codable protocol, which contains two other protocols: Encodable and Decodable How to decode a JSON data object into a readable Swift struct Usage of custom keys Custom objects creation Arrays Different top …
Last post was devoted to custom keys and custom objects. In this one let’s talk about top level entities and arrays, very common structures used in JSON files and responses.
In the last post we went through a little sneak peak of how easy it is to work with JSON since Swift 4. Now let’s keep it up and see how to deal with custom keys and custom objects.
DISCLAIMER: In this series of posts you’ll learn to work with JSON, not with JASON, the evil character from Friday the 13th series. Besides, working with JSON has become a pleasure since Swift 4… while JASON keeps being mean. So, drop your hockey mask and start coding!