Encoding and Decoding in Swift 4

Swift 4 introduces the Codable protocol, a really useful protocol which enables us to easily encode and decode conforming types. In this short post, Mohammed Azam demonstrates how we can use this feature to encode/decode our custom types to/from JSON.