As title says. I had one controller where I was setting interactivePopGestureRecognizer.delegate
to handle logic when to allow back swipe gesture and when not. It worked. But now I noticed that once I setup the delegate, the back swipe stops working. It really causes that one line of code. But why?
Yes, the controller where I used to handle the backswipe logic had everything needed (UIGestureRecognizerDelegate protocol
, gestureRecognizerShouldBegin delegate
method with return YES), but as I say, I discovered in another controller that by just calling the one line of the following code, back swipe doesn't work anymore. (Yes this another controller conforms to UIGestureRecognizerDelegate protocol)
self.navigationController.interactivePopGestureRecognizer.delegate = self;
It doesn't help if I add also:
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
return YES;
}
or
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
I wonder what is causing this? If I don't call that one line of code, back swipe works! And it even worked in the another controller where I handled the logic as I said.
Edit: I was setting the delegate from viewDidLoad. I tried also from viewDidAppear, but nothing.