I'm trying #swift and #swiftdata for the first time, and need help with an error.
I get: SwiftData/BackingData.swift:201: Fatal error: expected attribute to be Codable
while inserting this model into a context
@Model
final class Item {
var name: String
var kind: Kind
enum Kind: String, Codable {
case function
case module
}
init(name: String, kind: Kind) { ... }
}
Removing kind from the model fixes it.
Is this even my bug? Or a SwiftData issue?