insidegui / CloudKitCodable

An encoder and decoder for CKRecord
BSD 2-Clause "Simplified" License
387 stars 29 forks source link

Custom keys #5

Closed MaxHasADHD closed 11 months ago

MaxHasADHD commented 5 years ago

Is it possible to add support for custom keys? In CloudKit I have a property like "archived" but I'd want to define it as let isArchived: Bool

insidegui commented 5 years ago

Doesn't it work with the regular Codable mechanism of customizing keys?

struct MyThing: Codable {
    let isArchived: Bool

    enum CodingKeys: String, CodingKey {
        case isArchived = "archived"
    }
}