Skip to content

Commit

Permalink
Merge pull request alexzielenski#1 from alextrob/master
Browse files Browse the repository at this point in the history
Fix for long press gesture crashing app
  • Loading branch information
Alex Zielenski committed May 7, 2012
2 parents d2ba858 + 17f492e commit e4dde95
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions vendor/ZKRevealingTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,16 @@ - (void)_slideOutContentViewInDirection:(ZKRevealingTableViewCellDirection)direc

#pragma mark - UIGestureRecognizerDelegate

- (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
UIScrollView *superview = (UIScrollView *)self.superview;
CGPoint translation = [gestureRecognizer translationInView:superview];

// Make sure it is scrolling horizontally
return ((fabs(translation.x) / fabs(translation.y) > 1) ? YES : NO && (superview.contentOffset.y == 0.0 && superview.contentOffset.x == 0.0));
if ([gestureRecognizer respondsToSelector:@selector(translationInView:)]) {
UIScrollView *superview = (UIScrollView *)self.superview;
CGPoint translation = [(UIPanGestureRecognizer *)gestureRecognizer translationInView:superview];

// Make sure it is scrolling horizontally
return ((fabs(translation.x) / fabs(translation.y) > 1) ? YES : NO && (superview.contentOffset.y == 0.0 && superview.contentOffset.x == 0.0));
}
return NO;
}

@end

0 comments on commit e4dde95

Please sign in to comment.