Instance Method

indexRange(in:)

Return a Range<IndexSet.Index> which can be used to subscript the index set.

Declaration

func indexRange(in range: Range<IndexSet.Element>) -> Range<IndexSet.Index>

Parameters

range

The range of integers to include.

Discussion

The resulting range is the range of the intersection of the integers in range with the index set. The resulting range will be isEmpty if the intersection is empty.

See Also

Manipulating Indexes

var startIndex: IndexSet.Index

The beginning index in the set.

var endIndex: IndexSet.Index

The ending index in the set.

func index(after: IndexSet.Index) -> IndexSet.Index

Returns the index that follows the given index in the set.

func index(before: IndexSet.Index) -> IndexSet.Index

Returns the index that precedes the given index in the set.

func formIndex(after: inout IndexSet.Index)

Modifies the given index to refer to the item after the one it currently refers to.

func formIndex(before: inout IndexSet.Index)

Modifies the given index to refer to the item before the one it currently refers to.