UPDATE: now conforms to Swift 2.1b2 Suppose you want an ordered set. Set is great and all, but it’s unordered. You could always use a Set anyway, and sort the contents when needed. Or you could use an array, keep it sorted, and always insert new elements in the right place. Or, you could use a tree. One way to build a tree in Swift would be with a class that refers to itself. Something like this f