<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionView/indexPath(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionView(im)indexPathForItem:"
  },
  "title" : "indexPath(for:)"
}
-->

# indexPath(for:)

Returns the index path of the specified item.

```
func indexPath(for item: NSCollectionViewItem) -> IndexPath?
```

## Parameters

`item`

The item whose index path you want to know.

## Return Value

The item’s index path or `nil` if the item is not in the collection view.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)