insert(_:within:)
Inserts a range that contains only the specified index into the range set.
Declaration
@discardableResult mutating func insert<C>(_ index: Bound, within collection: C) -> Bool where Bound == C.Index, C : CollectionParameters
- index:
The index to insert into the range set.
indexmust be a valid index ofcollectionthat isn’t the collection’sendIndex. - collection:
The collection that contains
index.
Return Value
true if the range set was modified, or false if the given index was already in the range set.