Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Made comparison condition non-strict
Browse files Browse the repository at this point in the history
to prevent unwanted swipe allowance.
  • Loading branch information
Alexey Novikov authored and Alexey Novikov committed Jul 13, 2016
1 parent c0fb9ea commit 857e079
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions YMSwipeTableViewCell/PodFiles/UITableViewCell+Swipe.m
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,11 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer

if (gestureRecognizer == self.panGestureRecognizer) {
CGPoint translation = [(UIPanGestureRecognizer *)gestureRecognizer translationInView:gestureRecognizer.view];
if (translation.y == 0) {
if (translation.x > 0 && self.leftView == nil) {
if (translation.y == 0.f) {
if (translation.x >= 0.f && self.leftView == nil) {
return NO;
}
if (translation.x < 0 && self.rightView == nil) {
if (translation.x <= 0.f && self.rightView == nil) {
return NO;
}
return YES;
Expand Down

0 comments on commit 857e079

Please sign in to comment.