Skip to content

Instantly share code, notes, and snippets.

Avatar

Ted Park ParkSangGwon

View GitHub Profile
@jpotts18
jpotts18 / Alamofire-JSON-Serialization.md
Last active Aug 17, 2020
Alamofire JSON Serialization of Objects, Collections, Nesting
View Alamofire-JSON-Serialization.md

Alamofire JSON Serialization of Objects and Collections

Alamofire is a great Swift library developed by the creator of AFNetworking @mattt. The purpose of this gist is to explain how to use the built-in power of Alamofire to serialize your JSON. In this example we will be serializing a simple blog API. First we will start with serializing a single JSON object and add complexity as we go along.

Warning: This was written before Swift 1.2

A Single JSON Serialization

This is the first JSON object that we will be serializing.