---
title: IndexPath
framework: foundation
role: symbol
role_heading: Structure
path: foundation/indexpath
---

# IndexPath

A list of indexes that together represent the path to a specific location in a tree of nested arrays.

## Declaration

```swift
struct IndexPath
```

## Overview

Overview Each index in an index path represents the index into an array of children from one node in the tree to another, deeper, node.

## Topics

### Creating Index Paths

- [init()](foundation/indexpath/init().md)
- [init(index:)](foundation/indexpath/init(index:).md)
- [init(arrayLiteral:)](foundation/indexpath/init(arrayliteral:).md)
- [init(indexes:)](foundation/indexpath/init(indexes:)-7auqk.md)
- [init(indexes:)](foundation/indexpath/init(indexes:)-55we8.md)
- [IndexPath.Element](foundation/indexpath/element.md)

### Working with Special Node Names

- [endIndex](foundation/indexpath/endindex.md)
- [item](foundation/indexpath/item-8cp0y.md)
- [row](foundation/indexpath/row.md)
- [section](foundation/indexpath/section-8h7wo.md)
- [startIndex](foundation/indexpath/startindex.md)

### Accessing Nodes

- [subscript(_:)](foundation/indexpath/subscript(_:)-6p6ul.md)
- [subscript(_:)](foundation/indexpath/subscript(_:)-4pgu1.md)

### Adding Nodes

- [+(_:_:)](foundation/indexpath/+(_:_:).md)
- [+=(_:_:)](foundation/indexpath/+=(_:_:).md)

### Selecting Nodes

- [append(_:)](foundation/indexpath/append(_:)-6dxrh.md)
- [append(_:)](foundation/indexpath/append(_:)-6vsd5.md)
- [append(_:)](foundation/indexpath/append(_:)-7qv6f.md)
- [appending(_:)](foundation/indexpath/appending(_:)-93eco.md)
- [appending(_:)](foundation/indexpath/appending(_:)-53tcl.md)
- [appending(_:)](foundation/indexpath/appending(_:)-174v0.md)
- [compare(_:)](foundation/indexpath/compare(_:).md)
- [dropLast()](foundation/indexpath/droplast().md)
- [index(after:)](foundation/indexpath/index(after:).md)
- [index(before:)](foundation/indexpath/index(before:).md)
- [makeIterator()](foundation/indexpath/makeiterator().md)

### Excluding Nodes

- [dropLast()](foundation/indexpath/droplast().md)

### Iterating over Nodes

- [makeIterator()](foundation/indexpath/makeiterator().md)

### Comparing Index Paths

- [compare(_:)](foundation/indexpath/compare(_:).md)

### Manipulating Indexes

- [IndexPath.Index](foundation/indexpath/index.md)
- [startIndex](foundation/indexpath/startindex.md)
- [endIndex](foundation/indexpath/endindex.md)
- [index(after:)](foundation/indexpath/index(after:).md)
- [index(before:)](foundation/indexpath/index(before:).md)
- [IndexPath.Indices](foundation/indexpath/indices.md)

### Using Reference Types

- [NSIndexPath](foundation/nsindexpath.md)

### Initializers

- [init(item:section:)](foundation/indexpath/init(item:section:)-359jo.md)
- [init(item:section:)](foundation/indexpath/init(item:section:)-rib.md)
- [init(row:section:)](foundation/indexpath/init(row:section:).md)

### Instance Properties

- [item](foundation/indexpath/item-6rh8l.md)
- [section](foundation/indexpath/section-2059m.md)

## Relationships

### Conforms To

- [BidirectionalCollection](swift/bidirectionalcollection.md)
- [Collection](swift/collection.md)
- [Comparable](swift/comparable.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [ExpressibleByArrayLiteral](swift/expressiblebyarrayliteral.md)
- [Hashable](swift/hashable.md)
- [MutableCollection](swift/mutablecollection.md)
- [RandomAccessCollection](swift/randomaccesscollection.md)
- [ReferenceConvertible](foundation/referenceconvertible.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Sequence](swift/sequence.md)

## See Also

### Indexes

- [IndexSet](foundation/indexset.md)
