RangeReplaceableCollection

extension RangeReplaceableCollection where Self: MutableCollection, Index == Int

Available where Self: MutableCollection, Index == Int

  • From user vadian at stackoverflows Walks the length of the collection using swapAt to move all deleted items to the end. Then it performs a single remove operation. Removes substates at the provided indexes.

    Declaration

    Swift

    @inlinable
    public mutating func remove(at indexes: IndexSet)

    Parameters

    indexes

    Removes all items in the provided indexSet.