weissi / FRLayeredNavigationController

FRLayeredNavigationController, an iOS container view controller that works like a stack of paper with an API similar to UINavigationController.
Other
484 stars 61 forks source link

Lingering gesture recognizer when setting userInteractionEnabled = NO #36

Closed slkandy closed 11 years ago

slkandy commented 11 years ago

When you try to temporarily disable swiping by calling:

self.layeredNavigationController.userInteractionEnabled = NO;

The swiping will not be recognized (as expected), but FRLayeredNavigationController's gesture recognizer is not fully removed.

In my application I need to disable swiping and display a transparent UIView that allows for freehand drawing. I was having issues while drawing because touchesCancelled was getting called unexpectedly on my transparent UIView, which prevented the user from drawing anything.

I was able to fix this by calling removeGestureRecognizer in FRLayeredNavigationController's detachGestureRecognizer method:

- (void)detachGestureRecognizer
{
    [self.view removeGestureRecognizer:self.panGR];
    [self.panGR removeTarget:self action:NULL];
    self.panGR.delegate = nil;
    self.panGR = nil;
}
weissi commented 11 years ago

Thank you very much, that should be fixed in master as of commit cccc4756f8782ced9d602bd13b70f2c4031448bb