Hello,
I'm trying to use a #Predicate
filtering by an Enum
property. But in runtime I getSwiftData.SwiftDataError._Error.unsupportedPredicate
Somehow I couldn't find any recent posts related to this issue. Has anyone encountered this or been able to solve/workaround it? Will it be ever fixed?
What is the point in supporting stored enums if I cannot use them to run a query? I'm struggling with this since beta 1, it really seems that SwiftData is not a priority for Apple right now. I'm really trying to stick with it but I'm running into issues that are indefinitely delaying all my development every day.
@Model final class ModelA {
var name: String
enum ModelAType: Int, Codable { case type1 = 1, type2 }
var type: ModelAType
// ...
}
// ...
let predicateConstant = ModelA.ModelAType.type1
#Predicate<ModelA> { $0.type == predicateConstant }