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

Commit

Permalink
Merge pull request #7 from ppbdrinker/master
Browse files Browse the repository at this point in the history
Fixed swipe cell being stuck in a semi-revealed state.
  • Loading branch information
pwillsey authored Jul 14, 2016
2 parents b579795 + 857e079 commit 659fb93
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions YMSwipeTableViewCell/PodFiles/UITableViewCell+Swipe.m
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,6 @@ - (void)goToDefaultMode:(void (^)(BOOL finished))completion withAnimation:(BOOL)
- (void)panGesture:(UIPanGestureRecognizer *)recognizer
{
CGPoint translation = [recognizer translationInView:recognizer.view];
if (translation.x > 0 && self.leftView == nil) {
return;
}
if (translation.x < 0 && self.rightView == nil) {
return;
}

void (^initializeGestureRecognizerBeginningState)(void) = ^{
self.contentView.clipsToBounds = YES;
Expand Down Expand Up @@ -506,7 +500,13 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer

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

0 comments on commit 659fb93

Please sign in to comment.