I've read all about Sets and they don't fit the bill because my objects are not hashable (which is quite common).
I have a Product class
class Product: Object {
dynamic var sku: String!
dynamic var name: SomeUnhashableType!
dynamic var weight: String!
}
let uniqueProductArray = [productOne, productTwo, productThree]
uniqueProductArray.append(productOne)
I've read about using contains, indexOf, filter, etc. But they all use predicates and I'd like a non-predicate method.
What's the most elegant way of blocking duplicate objects from being appended to an array?
hashandisEqual:can do whatever you want (within required limits).