endIndex
TypeScriptget endIndex(): IndexSet_IndexSwift declarationvar endIndex: IndexSet.Index { get }The ending index in the set.
struct · iOS 8.0+ · SDK 27.1
struct IndexSetA collection of unique integer values that represent the indexes of elements in another collection. The range of valid integer values is 0..<INT_MAX-1. Anything outside this range is an error.
get endIndex(): IndexSet_IndexSwift declarationvar endIndex: IndexSet.Index { get }The ending index in the set.
formIndexAfter(i: IndexSet_Index): { $ret: null; $out: { "i": IndexSet_Index } }Swift declarationfunc formIndex(after i: inout IndexSet.Index)Modifies the given index to refer to the item after the one it currently refers to.
Omit the output parameters from the call. The result contains $ret and $out, with i inside $out.
formIndexBefore(i: IndexSet_Index): { $ret: null; $out: { "i": IndexSet_Index } }Swift declarationfunc formIndex(before i: inout IndexSet.Index)Modifies the given index to refer to the item before the one it currently refers to.
Omit the output parameters from the call. The result contains $ret and $out, with i inside $out.
get startIndex(): IndexSet_IndexSwift declarationvar startIndex: IndexSet.Index { get }The beginning index in the set.
filteredIndexSetIncludeInteger(includeInteger: ((arg0: number) => boolean)): IndexSetSwift declarationfunc filteredIndexSet(includeInteger: (IndexSet.Element) throws -> Bool) rethrows -> IndexSetReturns an IndexSet filtered according to the result of `includeInteger`. - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
filteredIndexSetInIncludeInteger(range: SDKHandle, includeInteger: ((arg0: number) => boolean)): IndexSetSwift declarationfunc filteredIndexSet(in range: ClosedRange<IndexSet.Element>, includeInteger: (IndexSet.Element) throws -> Bool) rethrows -> IndexSetReturns an IndexSet filtered according to the result of `includeInteger`. - parameter range: A range of integers. For each integer in the range that intersects the integers in the IndexSet, then the `includeInteger` predicate will be invoked. - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
filteredIndexSetInIncludeInteger84484(range: SDKHandle, includeInteger: ((arg0: number) => boolean)): IndexSetSwift declarationfunc filteredIndexSet(in range: Range<IndexSet.Element>, includeInteger: (IndexSet.Element) throws -> Bool) rethrows -> IndexSetReturns an IndexSet filtered according to the result of `includeInteger`. - parameter range: A range of integers. For each integer in the range that intersects the integers in the IndexSet, then the `includeInteger` predicate will be invoked. - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
indexRangeIn(range: SDKHandle): SDKHandleSwift declarationfunc indexRange(in range: Range<IndexSet.Element>) -> Range<IndexSet.Index>Return a `Range<IndexSet.Index>` which can be used to subscript the index set. 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. - parameter range: The range of integers to include.
indexRangeIn76027(range: SDKHandle): SDKHandleSwift declarationfunc indexRange<R>(in range: R) -> Range<IndexSet.Index> where R : RangeExpression, R.Bound == IntReturn a `Range<IndexSet.Index>` which can be used to subscript the index set. The resulting range is the range of the intersection of the integers in `range` with the index set. - parameter range: The range of integers to include.
static initIntegersIn(indices: SDKHandle): (IndexSet) | nullSwift declarationinit?(integersIn indices: RangeSet<Int>)static initIntegersIn12337(range: SDKHandle): IndexSetSwift declarationinit(integersIn range: Range<IndexSet.Element>)Initializes an index set with a range of integers.
static initIntegersIn1035(range: SDKHandle): IndexSetSwift declarationinit<R>(integersIn range: R) where R : RangeExpression, R.Bound == IntInitialize an `IndexSet` with a range of integers.
intersectsIntegersIn(range: SDKHandle): booleanSwift declarationfunc intersects(integersIn range: Range<IndexSet.Element>) -> BoolReturns `true` if `self` intersects any of the integers in `range`.
intersectsIntegersIn44000(range: SDKHandle): booleanSwift declarationfunc intersects<R>(integersIn range: R) -> Bool where R : RangeExpression, R.Bound == IntReturns `true` if `self` intersects any of the integers in `range`.
get description(): stringSwift declarationvar description: String { get }A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.
get customMirror(): SDKHandleSwift declarationvar customMirror: Mirror { get }The custom mirror for this instance. If this type has value semantics, the mirror should be unaffected by subsequent mutations of the instance.
intersection(other: IndexSet): IndexSetSwift declarationfunc intersection(_ other: IndexSet) -> IndexSetIntersects the `IndexSet` with `other`.
makeIterator(): SDKHandleSwift declarationfunc makeIterator() -> IndexingIterator<IndexSet>Returns an iterator over the elements of this sequence.
integerLessThan(integer: number): (number) | nullSwift declarationfunc integerLessThan(_ integer: IndexSet.Element) -> IndexSet.Element?Returns an integer contained in `self` which is less than `integer`, or `nil` if a result could not be found.
get debugDescription(): stringSwift declarationvar debugDescription: String { get }A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.
formIntersection(other: IndexSet): voidSwift declarationmutating func formIntersection(_ other: IndexSet)Intersects the `IndexSet` with `other`.
integerGreaterThan(integer: number): (number) | nullSwift declarationfunc integerGreaterThan(_ integer: IndexSet.Element) -> IndexSet.Element?Returns an integer contained in `self` which is greater than `integer`, or `nil` if a result could not be found.
symmetricDifference(other: IndexSet): IndexSetSwift declarationfunc symmetricDifference(_ other: IndexSet) -> IndexSetExclusive or the `IndexSet` with `other`.
formSymmetricDifference(other: IndexSet): voidSwift declarationmutating func formSymmetricDifference(_ other: IndexSet)Exclusive or the `IndexSet` with `other`.
integerLessThanOrEqualTo(integer: number): (number) | nullSwift declarationfunc integerLessThanOrEqualTo(_ integer: IndexSet.Element) -> IndexSet.Element?Returns an integer contained in `self` which is less than or equal to `integer`, or `nil` if a result could not be found.
integerGreaterThanOrEqualTo(integer: number): (number) | nullSwift declarationfunc integerGreaterThanOrEqualTo(_ integer: IndexSet.Element) -> IndexSet.Element?Returns an integer contained in `self` which is greater than or equal to `integer`, or `nil` if a result could not be found.
get last(): (number) | nullSwift declarationvar last: IndexSet.Element? { get }Returns the last integer in `self`, or nil if `self` is empty.
countIn(range: SDKHandle): numberSwift declarationfunc count(in range: Range<IndexSet.Element>) -> IntReturns the count of integers in `self` that intersect `range`.
countIn73912(range: SDKHandle): numberSwift declarationfunc count<R>(in range: R) -> Int where R : RangeExpression, R.Bound == IntReturns the count of integers in `self` that intersect `range`.
get count(): numberSwift declarationvar count: Int { get }Returns the number of integers in `self`.
get first(): (number) | nullSwift declarationvar first: IndexSet.Element? { get }Returns the first integer in `self`, or nil if `self` is empty.
indexAfter(i: IndexSet_Index): IndexSet_IndexSwift declarationfunc index(after i: IndexSet.Index) -> IndexSet.IndexReturns the index that follows the given index in the set.
indexBefore(i: IndexSet_Index): IndexSet_IndexSwift declarationfunc index(before i: IndexSet.Index) -> IndexSet.IndexReturns the index that precedes the given index in the set.
shift(integer: number, delta: number): voidSwift declarationmutating func shift(startingAt integer: IndexSet.Element, by delta: Int)For a positive delta, shifts the indexes in [index, INT_MAX] to the right, thereby inserting an "empty space" [index, delta], for a negative delta, shifts the indexes in [index, INT_MAX] to the left, thereby deleting the indexes in the range [index - delta, delta].
union(other: IndexSet): IndexSetSwift declarationfunc union(_ other: IndexSet) -> IndexSetUnion the `IndexSet` with `other`.
insertIntegersIn(range: SDKHandle): voidSwift declarationmutating func insert(integersIn range: Range<IndexSet.Element>)Insert a range of integers into the `IndexSet`.
insertIntegersIn73454(range: SDKHandle): voidSwift declarationmutating func insert<R>(integersIn range: R) where R : RangeExpression, R.Bound == IntInsert a range of integers into the `IndexSet`.
insert(integer: number): { "inserted": boolean; "memberAfterInsert": number }Swift declaration@discardableResult mutating func insert(_ integer: IndexSet.Element) -> (inserted: Bool, memberAfterInsert: IndexSet.Element)Insert an integer into the `IndexSet`.
removeIntegersIn(range: SDKHandle): voidSwift declarationmutating func remove(integersIn range: ClosedRange<IndexSet.Element>)Remove a range of integers from the `IndexSet`.
removeIntegersIn20292(range: SDKHandle): voidSwift declarationmutating func remove(integersIn range: Range<IndexSet.Element>)Remove a range of integers from the `IndexSet`.
remove(integer: number): (number) | nullSwift declaration@discardableResult mutating func remove(_ integer: IndexSet.Element) -> IndexSet.Element?Remove an integer from the `IndexSet`.
update(integer: number): (number) | nullSwift declaration@discardableResult mutating func update(with integer: IndexSet.Element) -> IndexSet.Element?Insert an integer into the `IndexSet`.
static initInteger(integer: number): IndexSetSwift declarationinit(integer: IndexSet.Element)Initializes an index set with a single integer.
get isEmpty(): booleanSwift declarationvar isEmpty: Bool { get }Returns `true` if self contains no values.
containsIntegersIn(indexSet: IndexSet): booleanSwift declarationfunc contains(integersIn indexSet: IndexSet) -> BoolReturns `true` if `self` contains all of the integers in `indexSet`.
containsIntegersIn32721(range: SDKHandle): booleanSwift declarationfunc contains(integersIn range: Range<IndexSet.Element>) -> BoolReturns `true` if `self` contains all of the integers in `range`.
containsIntegersIn83322(range: SDKHandle): booleanSwift declarationfunc contains<R>(integersIn range: R) -> Bool where R : RangeExpression, R.Bound == IntReturns `true` if `self` contains all of the integers in `range`.
contains(integer: number): booleanSwift declarationfunc contains(_ integer: IndexSet.Element) -> BoolReturns `true` if `self` contains `integer`.
formUnion(other: IndexSet): voidSwift declarationmutating func formUnion(_ other: IndexSet)Union the `IndexSet` with `other`.
rangeViewOf(range: SDKHandle): IndexSet_RangeViewSwift declarationfunc rangeView(of range: Range<IndexSet.Element>) -> IndexSet.RangeViewReturns a `Range`-based view of `self`. - parameter range: A subrange of `self` to view.
rangeViewOf33558(range: SDKHandle): IndexSet_RangeViewSwift declarationfunc rangeView<R>(of range: R) -> IndexSet.RangeView where R : RangeExpression, R.Bound == IntReturns a `Range`-based view of `self`. - parameter range: A subrange of `self` to view.
get rangeView(): IndexSet_RangeViewSwift declarationvar rangeView: IndexSet.RangeView { get }Returns a `Range`-based view of the entire contents of `self`. - seealso: rangeView(of:)
removeAll(): voidSwift declarationmutating func removeAll()Remove all values from the `IndexSet`.
static init(): IndexSetSwift declarationinit()Initializes an empty index set.
subscript(index: IndexSet_Index): numberSwift declarationsubscript(index: IndexSet.Index) -> IndexSet.Element { get }Accesses one element in the index set.
subscript4044(bounds: SDKHandle): SDKHandleSwift declarationsubscript(bounds: Range<IndexSet.Index>) -> Slice<IndexSet> { get }Accesses a contiguous subrange of the collection's elements. The accessed slice uses the same indices for the same elements as the original collection uses. Always use the slice's `startIndex` property instead of assuming that its indices start at a particular value. This example demonstrates getting a slice of an array of strings, finding the index of one of the strings in the slice, and then using that index in the original array. let streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"] let streetsSlice = streets[2 ..< streets.endIndex] print(streetsSlice) // Prints "["Channing", "Douglas", "Evarts"]" let index = streetsSlice.firstIndex(of: "Evarts") // 4 print(streets[index!]) // Prints "Evarts" - Parameter bounds: A range of the collection's indices. The bounds of the range must be valid indices of the collection. - Complexity: O(1)
No declarations were skipped in this snapshot.