Contents

indexPathForItem(at:)

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

Declaration

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

Parameters

  • point:

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

Return Value

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

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