---
title: "indexPathForItem(at:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscollectionview/indexpathforitem(at:)"
---

# indexPathForItem(at:)

Returns the index path of the item at the specified point.

## Declaration

```swift
func indexPathForItem(at point: NSPoint) -> IndexPath?
```

## Parameters

- `point`: The point in the collection view’s bounds that you want to test.

## Return Value

Return Value The item at the specified point or nil if no item was found at that point.

## Discussion

Discussion This method uses the available layout attributes to determine which item is at the specified point. If more than one item is at the point, this method returns only the top-most item. This method ignores the opacity of the item, so items that are fully transparent are still returned by this method. Hidden items are never returned.

## See Also

### Locating Items and Views

- [visibleItems()](appkit/nscollectionview/visibleitems().md)
- [indexPathsForVisibleItems()](appkit/nscollectionview/indexpathsforvisibleitems().md)
- [visibleSupplementaryViews(ofKind:)](appkit/nscollectionview/visiblesupplementaryviews(ofkind:).md)
- [indexPathsForVisibleSupplementaryElements(ofKind:)](appkit/nscollectionview/indexpathsforvisiblesupplementaryelements(ofkind:).md)
- [indexPath(for:)](appkit/nscollectionview/indexpath(for:).md)
- [item(at:)](appkit/nscollectionview/item(at:)-2vx2h.md)
- [supplementaryView(forElementKind:at:)](appkit/nscollectionview/supplementaryview(forelementkind:at:).md)
- [scrollToItems(at:scrollPosition:)](appkit/nscollectionview/scrolltoitems(at:scrollposition:).md)
