Codable Enums

Swift 4’s Codable protocols make it very easy to encode and decode conforming types, even working with enums when the enums rawValue also conforms to Codable. However, things get a little bit more complicated when dealing with enums which have associated values. This post from Little Bites of Cocoa shows us how we can handle such a situation.