---
title: "index(before:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/indexpath/index(before:)"
---

# index(before:)

Returns the index that precedes the given index.

## Declaration

```swift
func index(before i: IndexPath.Index) -> IndexPath.Index
```

## See Also

### 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)
- [makeIterator()](foundation/indexpath/makeiterator().md)
