fastred / SloppySwiper

UINavigationController delegate that allows swipe back gesture to be started from anywhere on the screen (not just from the edge).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I enable sloppy swipe while UIScrollView scrolling

yukitoto opened this issue · comments

I use bellow code, but sloppy swipe not work while UIScrollView scrolling

cf. #13

@interface SloppyScrollView : UIScrollView
@EnD

- (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer {
    CGPoint velocity = [gestureRecognizer velocityInView:self];
    if(velocity.x > 0 && self.contentOffset.x == 0) {
        return NO;
    }
    return YES;
}