Use predicate as a static function
https://developer.apple.com/documentation/swiftdata/filtering-and-sorting-persistent-data#Define-a-filter-using-a-predicate
filter: predicate(),
static func predicate() -> Predicate<Flashcard> {
let now = Date()
return #Predicate<Flashcard> { $0.nextReviewAt <= now }
}
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: