Get unique values in a Swift array




Get unique values in a Swift array

Recently I was working on an IOS app in Swift language. I came through an issue that I was having an array. That array was filled with values on run time. Most of values were duplicate. So I need to get a unique array. In Swift I did not find  a function to get  unique values. After some Google search I found a same type of question on Stackoverflow and the answer was the solution to my problem.

 

Unique values of array in swift