Collection

protocol Collection : Sequence
  • Return a random element from the collection

    Declaration

    Swift

    public var randomIndex: Index
  • Retrieve a random element from the collection

    Declaration

    Swift

    public func randomElement() -> Iterator.Element