Codable

protocol Encodable {
    func encode(to encoder: Encoder) throws
}

protocol Decodable {
    init(from decoder: Decoder) throws
}

typealias Codable = Decodable & Encodable

If a type’s properties are all codable, the type automatically conforms to Codable, and nothing needs to be implemented

Coders

  • PropertyListEncoder
    • Array, Bool, Data, Date, Dictionary, Float, Int, String
  • JSONEncoder