I want to check whether one of object is exist in another array.
My object is:
class obj: NSObject {
var obj_id: Int?
var status: Int?
}
NOTE : I want to compare by
obj_id.
For example, an array of [obj1, obj2 ,obj3], I want to check if obj2 or obj3 are in the array [obj2, obj3, obj4, obj5].
codelet find = otherArray.filter { itemInOtherAray.obj_id == object.obj_id }.first if (find != nil) { //do something }code