Post

Replies

Boosts

Views

Activity

Reply to SwiftData - Problems with Predicates and Relations
The hashtags come from my HashtagFilter model and are attached there as a relationship. @Model final class HashtagFilter: Identifiable, Hashable, NamedEntity { @Relationship(inverse: \Hashtag.hashtagFilter) var tags: [Hashtag] var displayName: String @Relationship(deleteRule: .cascade, inverse: \HashtagFilter.parentItem) var children: [HashtagFilter]? var parentItem: HashtagFilter? @Transient var isEditing: Bool = false init(displayName: String) { self.tags = [] self.children = [] self.displayName = displayName } } ``` The filterHashtags come from HashtagFilter.tags. If I check for equality in my code, it works. It just doesn't work in the Predicate. However, due to the amount of data, I would like to perform this filtering in the Predicate
Oct ’24