---
title: "index(after:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/collection/index(after:)"
---

# index(after:)

Returns the position immediately after the given index.

## Declaration

```swift
func index(after i: Self.Index) -> Self.Index
```

## Parameters

- `i`: A valid index of the collection. i must be less than endIndex.

## Return Value

Return Value The index value immediately after i.

## Discussion

Discussion The successor of an index must be well defined. For an index i into a collection c, calling c.index(after: i) returns the same index every time.

## See Also

### Manipulating Indices

- [startIndex](swift/collection/startindex.md)
- [endIndex](swift/collection/endindex.md)
- [indices](swift/collection/indices-9kkbf.md)
- [formIndex(_:offsetBy:)](swift/collection/formindex(_:offsetby:)-393pr.md)
- [formIndex(_:offsetBy:limitedBy:)](swift/collection/formindex(_:offsetby:limitedby:)-6jwra.md)
