Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

Use indexPathForItemAtPoint: for long press. #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pbernery
Copy link

handleLongPressGesture: was using indexPathForItemClosestToPoint: method to
retrieve the index path of the pressed cell. This works well on layouts
that fill the entire collection view space but not on other layouts: in the
latter case, the closest cell will be selected whereas this is the one under the
finger we want to be selected.

It now uses indexPathForItemAtPoint: instead of
indexPathForItemClosestToPoint: to get the touched cell.

An by the way, your lib is awesome: I added dragging in a complex layout in a couple of hours.

`handleLongPressGesture:` was using `indexPathForItemClosestToPoint:` method to
retrieve the index path of the pressed cell. This works well on layouts
that fill the entire collection view space but not on other layouts: in the
latter case, the closest cell will be selected whereas this is the one under the
finger we want to be selected.

It now uses `indexPathForItemAtPoint:` instead of
`indexPathForItemClosestToPoint:` to get the touched cell.
dredenba pushed a commit to dredenba/DraggableCollectionView that referenced this pull request Apr 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant