- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if (gestureRecognizer == mPanGestureRecognizer) { 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)); } returnNO; }