larryryu / LSSwipeToDeleteCollectionViewLayout

The UICollectionViewLayout subclass adds swipe to delete functionality to a collectionview
MIT License
41 stars 4 forks source link

Fix to prevent deleting before escape distance is met #7

Open batkru opened 9 years ago

batkru commented 9 years ago

This fix prevents deleting under a very sensitive condition.

larryryu commented 9 years ago

I don't think this is necessary because if the swipe was fast/violent enough we can treat that as an intent to delete. You can also adjust the "deletionVelocityTresholdValue" value to a more suitable setting. What do you think?

batkru commented 9 years ago

The main reason I put this is since when in horizontal mode with cells that are full screen when users swipe from left to right, sometimes the gesture is triggered without them really wanting to actually trigger (their thumb sometimes goes in angles that are not necessarily completely horizontal). Adding this fixed the behavior and users stopped complaining as the gesture was only really triggered when the distance met the threshold. I leave it up to you to verify and decide :)