---
title: "index(ofItemIdentifier:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nsdiffabledatasourcesnapshotreference/index(ofitemidentifier:)"
---

# index(ofItemIdentifier:)

Returns the index of the item in the snapshot with the specified identifier.

## Declaration

```swift
func index(ofItemIdentifier itemIdentifier: Any) -> Int
```

## Parameters

- `itemIdentifier`: The identifier of the item in the snapshot.

## Return Value

Return Value The index of the item in the snapshot, or NSNotFound if the item with the specified identifier doesn’t exist in the snapshot. This index value is 0-based.

## See Also

### Identifying items and sections

- [itemIdentifiers](uikit/nsdiffabledatasourcesnapshotreference/itemidentifiers.md)
- [sectionIdentifiers](uikit/nsdiffabledatasourcesnapshotreference/sectionidentifiers.md)
- [index(ofSectionIdentifier:)](uikit/nsdiffabledatasourcesnapshotreference/index(ofsectionidentifier:).md)
- [itemIdentifiersInSection(withIdentifier:)](uikit/nsdiffabledatasourcesnapshotreference/itemidentifiersinsection(withidentifier:).md)
- [sectionIdentifier(forSectionContainingItemIdentifier:)](uikit/nsdiffabledatasourcesnapshotreference/sectionidentifier(forsectioncontainingitemidentifier:).md)
