Took a break from guided learning over the weekend and messed around with SwiftUI in another project. Today, I resumed and learned more about Codable
. Specifically, how to assign different names for properties when writing to files, reading data from an API, etc.
struct Task: Identifiable, Codable {
let id = UUID()
var name: String
var completed = false
enum CodingKeys: String, CodingKey {
case id = "identifier"
case name
case completed = "is_complete"
}
}