5

I need to convert a Set into an array of either [AnyObject] or [String] is this possible? I know with an NSSet I can use .allObjects but there doesn't seem to be any functions for this with a native set

Tyler
  • 2,346
  • 6
  • 33
  • 59

1 Answers1

18

Just coerce directly to an Array:

let arr = Array(mySet)
matt
  • 515,959
  • 87
  • 875
  • 1,141