---
title: "index(after:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/scene/anchorcollection/index(after:)"
---

# index(after:)

Returns the position immediately after the given index.

## Declaration

```swift
@MainActor @preconcurrency func index(after i: Int) -> Int
```

## Parameters

- `i`: A valid index of the collection. Use a value less than doc://com.apple.RealityKit/documentation/RealityKit/Scene/AnchorCollection/endIndex.

## Return Value

Return Value The index value immediately after i.

## See Also

### Manipulating indices

- [Scene.AnchorCollection.Index](realitykit/scene/anchorcollection/index.md)
- [startIndex](realitykit/scene/anchorcollection/startindex.md)
- [endIndex](realitykit/scene/anchorcollection/endindex.md)
