If you have Set<String> , you can use the Array constructor:
let set: Set<String> = // ... let strings = Array(set)
Or, if you have an NSSet, there are several different options:
let set: NSSet = // ... let strings1 = set.allObjects as? [String] // or as! let strings2 = Array(set as! Set<String>) let strings3 = (set as? Set<String>).map(Array.init)
jtbandes
source share