I have an issue and need your help. I have array of objects
var arrayDirection: [Directions]
every object has properties:
var name: String?
var uniqueId: Int?
I need find and leave only one object whose values of properties duplicate values of properties of another objects from that array.
For example I print in console:
for object in arrayDirection {
print(object.name, object.uniqueId)
}
and see:
Optional("name1") Optional(833)
Optional("name1") Optional(833)
Optional("name2") Optional(833)
Optional("name4") Optional(833)
Optional("name1") Optional(833)
Optional("name1") Optional(862)
So, I need remove Optional("name1") Optional(833)
because there are 3 in array and leave only one as result I'd like to see:
Optional("name1") Optional(833)
Optional("name2") Optional(833)
Optional("name3") Optional(833)
Optional("name1") Optional(862)