I'm building an iOS app with swift and i need to get all unique values of array of strings.
I've been reading the apple developer docs but it doesn't seem to have a function for it.
Can someone give me an hint?
iosswift
I'm building an iOS app with swift and i need to get all unique values of array of strings.
I've been reading the apple developer docs but it doesn't seem to have a function for it.
Can someone give me an hint?
Best Answer
There might be a more efficient way, but an extension would probably be most straightforward:
If order doesn't matter and objects are also hashable: