Please check this code, I used NSArray after receiving a filter that you can convert to a fast array
let arr = [1, 1, 1, 2, 2, 3, 4, 5, 6, nil, nil, 8]
let filterSet = NSSet(array: arr as NSArray as! [NSObject])
let filterArray = filterSet.allObjects as NSArray
print("Filter Array:\(filterArray)")
source
share