diff --git a/LSSwipeToDeleteCollectionViewLayout/LSSwipeToDeleteCollectionViewLayout.m b/LSSwipeToDeleteCollectionViewLayout/LSSwipeToDeleteCollectionViewLayout.m index 7056909..3e0ff0b 100644 --- a/LSSwipeToDeleteCollectionViewLayout/LSSwipeToDeleteCollectionViewLayout.m +++ b/LSSwipeToDeleteCollectionViewLayout/LSSwipeToDeleteCollectionViewLayout.m @@ -224,7 +224,7 @@ - (void)handlePanGesture:(UIPanGestureRecognizer *)gesture{ break; } - + case UIGestureRecognizerStateEnded: case UIGestureRecognizerStateCancelled: case UIGestureRecognizerStateFailed: @@ -289,7 +289,7 @@ -(LSSwipeToDeleteDirection)deletionDirectionWithGestureRecogniser:(UIPanGestureR if (escapeDistance > self.deletionDistanceTresholdValue && [self isTranslationInDeletionDirection:tranlastion]) { direction = [self swipeToDeleteDirectionFromValue:tranlastion]; - }else if (escapeVelocity > self.deletionVelocityTresholdValue && [self isVelocityInDeletionDirection:velocity]){ + }else if (escapeVelocity > self.deletionVelocityTresholdValue && [self isVelocityInDeletionDirection:velocity] && escapeDistance > self.deletionDistanceTresholdValue){ direction = [self swipeToDeleteDirectionFromValue:tranlastion]; } @@ -441,7 +441,7 @@ -(BOOL)isVelocityInDeletionDirection:(CGPoint)velocity{ if (userTriggerredSwipeToDeleteVelocityDirection == LSSwipeToDeleteDirectionNone) { inDeletionDirection = NO; } - + return inDeletionDirection; }