Skip to content

Instantly share code, notes, and snippets.

@blixt
Created February 21, 2015 20:09
Show Gist options
  • Save blixt/3b51b96a0e99fb5e3143 to your computer and use it in GitHub Desktop.
Save blixt/3b51b96a0e99fb5e3143 to your computer and use it in GitHub Desktop.
- (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)recognizer {
if (recognizer != self.panGestureRecognizer) {
if ([super respondsToSelector:@selector(gestureRecognizerShouldBegin:)]) {
return [super gestureRecognizerShouldBegin:recognizer];
} else {
return YES;
}
}
CGPoint translation = [recognizer translationInView:self];
// Fail vertical swipes.
return (abs(translation.y) < abs(translation.x));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment