I have a array of object of custom class. My class is Person. So i want to check if arrPerson contains an object then it should not be added again in array.
Here is my code
for value in data {
if self.arrPerson.contains(where: {($0.id != value.id)}){
self.arrPerson.append(value)
}
}
Please tell me how can i check if object of custom class already added then it should not be added again