---
title: "itemIdentifier(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewdiffabledatasourcereference/itemidentifier(for:)"
---

# itemIdentifier(for:)

Returns an identifier for the item at the specified index path in the collection view.

## Declaration

```swift
func itemIdentifier(for indexPath: IndexPath) -> Any?
```

## Parameters

- `indexPath`: The index path of the item in the collection view.

## Return Value

Return Value The item’s identifier, or nil if no item is found at the provided index path.

## Discussion

Discussion This method is a constant time operation, O(1), which means you can look up an item identifier from its corresponding index path with no significant overhead.

## See Also

### Identifying items

- [indexPath(forItemIdentifier:)](uikit/uicollectionviewdiffabledatasourcereference/indexpath(foritemidentifier:).md)
