Instance Method

remove(at:)

Removes the element at the given index of the set.

Declaration

@discardableResult mutating func remove(at position: Set<Element>.Index) -> Element

Parameters

position

The index of the member to remove. position must be a valid index of the set, and must not be equal to the set’s end index.

Return Value

The element that was removed from the set.

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 removeAll(keepingCapacity: Bool)

Removes all members from the set.