You got the same thing on the UICollectionView
. According to the documentation:
indexPathForItemAtPoint: Returns the index path of the item at the specified point in the collection view.
- (NSIndexPath *)indexPathForItemAtPoint:(CGPoint)point Parameters point A point in the collection view’s coordinate system. Return Value The index path of the item at the specified point or nil if no item was found at the specified point.
Discussion This method relies on the layout information provided by the associated layout object to determine which item contains the point.
Availability Available in iOS 6.0 and later. Declared In UICollectionView.h