Instance Method


Removes all members from the set.


mutating func removeAll(keepingCapacity keepCapacity: Bool = false)



If true, the set’s buffer capacity is preserved; if false, the underlying buffer is released. The default is false.

See Also

Removing Elements

func filter((Element) -> Bool) -> Set<Element>

Returns a new set containing the elements of the set that satisfy the given predicate.

func remove(Element) -> Element?

Removes the specified element from the set.

func removeFirst() -> Element

Removes the first element of the set.

func remove(at: Set<Element>.Index) -> Element

Removes the element at the given index of the set.