Hi,
given this model:
@Model
class OnlyName {
var name: String
init(name: String) {
self.name = name
}
}
I would assume that I could write a predicate like this:
#Predicate<OnlyName> { $0.name == other.name }
, where other
is also an instance of OnlyName
for example returned by an earlier fetch.
Unfortunately this results in the following compiler errors:
Initializer 'init(_:)' requires that 'OnlyName' conform to 'Encodable'
Initializer 'init(_:)' requires that 'OnlyName' conform to 'Decodable'
Any idea if this is a bug in SwiftData or if I am missing something?
Cheers, Michael