Post

Replies

Boosts

Views

Activity

Reply to @Query SortDescriptor with a Boolean
Hello, I have not yet used SwiftData, but what init are you using for the SortDescriptor? I see this one in the documentation: [https://developer.apple.com/documentation/foundation/sortdescriptor/3802525-init) init( _ keyPath: KeyPath<Compared, Bool>, order: SortOrder = .forward ) where Compared : NSObject Is says that is needs to conform to NSObject. So might need to bridge it somehow so that the types are compatible. There is a way to do it via NSNumber.
Oct ’23