Set

struct Set<Element> where Element : Hashable

This extension adds some useful functions to Set.

  • Randomly selects an element from self and returns it.

    Declaration

    Swift

    public func random() -> Element

    Return Value

    An element that was randomly selected from the set.