Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panning gesture #40

Closed
vargarobert opened this issue Mar 28, 2014 · 3 comments
Closed

Panning gesture #40

vargarobert opened this issue Mar 28, 2014 · 3 comments

Comments

@vargarobert
Copy link

It would be good to have a feature that blocks the pan gesture on the X-axis when a user let's say pans on the Y-axis and the navbar hides. One pan gesture at a time.

@zzz6519003
Copy link
Contributor

good call!

@papauschek
Copy link

I had this problem and fixed it by using the panGesture recognizer of the scrollview, (instead of creating your own, like AMScrollingNavbar does right now)

The solution inside the followScrollView method in UIViewController+ScrollingNavbar.m looks like this:

    UIScrollView* scrollView = (UIScrollView*)self.scrollableView;
    if (![scrollView isKindOfClass:UIScrollView.class]) {
        self.panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
        [self.panGesture setMaximumNumberOfTouches:1];

        [self.panGesture setDelegate:self];
        [self.scrollableView addGestureRecognizer:self.panGesture];
    } else {
        // use existing pan gesture recognizer to avoid nested scrolling issues
        [scrollView.panGestureRecognizer addTarget:self action:@selector(handlePan:)];
    }

@andreamazz
Copy link
Owner

Closing this issue. Please refer to this #146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants