So, basically, the problem is, I have an object, let's call it "Product"
struct Product {
let categories: [Category]
}
And Category looks like this:
struct Category {
let id: Int
}
What I need, is to create NSPredicate, that would check if categories list contains Category of certain id. Now sure if it's possible, but maybe there's better workaround than creating another property with simple Int array? Update: NSPredicate is mandatory because I need to use it in Realm database filter query.
NSPredicate? There are other, more concise, ways to filter arrays in Swift.