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

# index(before:)

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

## Declaration

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

## See Also

### Manipulating Indexes

- [startIndex](foundation/indexset/startindex.md)
- [endIndex](foundation/indexset/endindex.md)
- [index(after:)](foundation/indexset/index(after:).md)
- [formIndex(after:)](foundation/indexset/formindex(after:).md)
- [formIndex(before:)](foundation/indexset/formindex(before:).md)
- [indexRange(in:)](foundation/indexset/indexrange(in:)-539lz.md)
