Hello,
I have similar problem, I just want to store enum in my @Model like this:
class Cat {
init(name: String,
birthDay: Date?,
breed: Breed?
) {
self.name = name
self.birthDay = birthDay
self.breed = breed
}
let name: String
let birthDay: Date?
let breed: Breed?
@Attribute(.unique)
let id = UUID()
}
enum Breed: String {
case unknown = "Unknown"
case ragdoll = "Ragdoll"
}
I also get three errors:
Instance method 'setValue(for:to:)' requires that 'Breed' conform to 'PersistentModel'
No exact matches in call to instance method 'getValue'
No exact matches in call to instance method 'setValue'
Have not found much information how to deal with that.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: