One Logo Pool Ball
Foundation · IOS API REFERENCE

IndexPath

struct · iOS 8.0+ · SDK 27.1

struct IndexPath

A list of indexes that together represent the path to a specific location in a tree of nested arrays. Each index in an index path represents the index into an array of children from one node in the tree to another, deeper, node.

Members (23)

get · iOS 8.0+

endIndex

TypeScript
get endIndex(): SDKHandle
Swift declaration
var endIndex: IndexPath.Index { get }

One past the index of the last node in the index path.

get · iOS 8.0+

startIndex

TypeScript
get startIndex(): SDKHandle
Swift declaration
var startIndex: IndexPath.Index { get }

The index of the first node in the index path.

get · iOS 8.0+

description

TypeScript
get description(): string
Swift declaration
var 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 · iOS 8.0+

customMirror

TypeScript
get customMirror(): SDKHandle
Swift declaration
var 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.

method · iOS 8.0+

makeIterator

TypeScript
makeIterator(): "section" | "row" | "item" | SDKHandle
Swift declaration
func makeIterator() -> IndexingIterator<IndexPath>

Returns an iterator over the nodes of the index path.

get · iOS 8.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var 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.

get · iOS 8.0+

count

TypeScript
get count(): number
Swift declaration
var count: Int { get }

The number of elements in the collection. To check whether a collection is empty, use its `isEmpty` property instead of comparing `count` to zero. Unless the collection guarantees random-access performance, calculating `count` can be an O(*n*) operation. - Complexity: O(1) if the collection conforms to `RandomAccessCollection`; otherwise, O(*n*), where *n* is the length of the collection.

method · iOS 8.0+

index

TypeScript
indexAfter(i: SDKHandle): SDKHandle
Swift declaration
func index(after i: IndexPath.Index) -> IndexPath.Index

Returns the index that follows the given index.

method · iOS 8.0+

index

TypeScript
indexBefore(i: SDKHandle): SDKHandle
Swift declaration
func index(before i: IndexPath.Index) -> IndexPath.Index

Returns the index that precedes the given index.

init · iOS 8.0+

init

TypeScript
static initIndex(index: number): IndexPath
Swift declaration
init(index: IndexPath.Element)

Creates an index path with a single element.

method · iOS 8.0+

append

TypeScript
append(other: IndexPath): void
Swift declaration
mutating func append(_ other: IndexPath)

Appends the nodes of another index path to this one.

method · iOS 8.0+

append

TypeScript
append13758(other: Array<number>): void
Swift declaration
mutating func append(_ other: Array<IndexPath.Element>)

Appends an array of elements to this index path as additional nodes.

method · iOS 8.0+

append

TypeScript
append46714(other: number): void
Swift declaration
mutating func append(_ other: IndexPath.Element)

Appends a single element to this index path as a new node.

method · iOS 8.0+

compare

TypeScript
compare(other: IndexPath): ComparisonResult
Swift declaration
func compare(_ other: IndexPath) -> ComparisonResult

Compares this index path to another in depth-first traversal order.

init · iOS 8.0+

init

TypeScript
static initIndexes(indexes: Array<number>): IndexPath
Swift declaration
init(indexes: Array<IndexPath.Element>)

Creates an index path from an array of elements.

init · iOS 8.0+

init

TypeScript
static initIndexes7489(indexes: Array<number>): IndexPath
Swift declaration
init<ElementSequence>(indexes: ElementSequence) where ElementSequence : Sequence, ElementSequence.Element == Int

Creates an index path from a sequence of integers.

method · iOS 8.0+

dropLast

TypeScript
dropLast(): IndexPath
Swift declaration
func dropLast() -> IndexPath

Returns a new index path containing all but the last element.

method · iOS 8.0+

appending

TypeScript
appending(other: IndexPath): IndexPath
Swift declaration
func appending(_ other: IndexPath) -> IndexPath

Returns a new index path containing the elements of this one plus those of another index path.

method · iOS 8.0+

appending

TypeScript
appending32326(other: Array<number>): IndexPath
Swift declaration
func appending(_ other: Array<IndexPath.Element>) -> IndexPath

Returns a new index path containing the elements of this one plus an array of additional elements.

method · iOS 8.0+

appending

TypeScript
appending74034(other: number): IndexPath
Swift declaration
func appending(_ other: IndexPath.Element) -> IndexPath

Returns a new index path containing the elements of this one plus the given element.

init · iOS 8.0+

init

TypeScript
static init(): IndexPath
Swift declaration
init()

Creates an empty index path.

subscript · iOS 8.0+

subscript

TypeScript
subscript(range: SDKHandle): IndexPath
Swift declaration
subscript(range: Range<IndexPath.Index>) -> IndexPath { get set }

Accesses a contiguous subrange of the index path's nodes.

subscript · iOS 8.0+

subscript

TypeScript
subscript82543(index: SDKHandle): number
Swift declaration
subscript(index: IndexPath.Index) -> IndexPath.Element { get set }

Accesses one of the index path's nodes.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

IndexPath.init(arrayLiteral:)

A variable number of Swift arguments is not supported.

All Foundation types →