Is there any way to know which collection view cell is at a specific point?
问题 I have a CGPoint and I would like to know which cell from my collection view currently contains that point. Is there any simple way to do this or do I have to write my own method? 回答1: I haven't used UICollectionView s much, but there's a method that seems perfect: - (NSIndexPath *)indexPathForItemAtPoint:(CGPoint)point; The point you pass to the method has to be within the coordinate system of the collection view. You can do: CGPoint convertedPoint = [collectionView convertPoint:point