Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UINavigationContoller interactivePopGestureRecognizer inactive when navigation bar is hidden

I have a view controller which is nested within a UINavigationController.

I have implemented the iOS 7 interactivePopGestureRecognizer to enable the user to gesture to pop a VC off the stack.

Within the VC i have a scrollview and whilst the user is not at the top of the scrollview I hide all the chrome (Navigation bar and status bar) to place focus on the content.

However with the navigation bar hidden, the interactivePopGestureRecognizer is not working.

I have tried enabling it after it has disappeared and verified it is not nil, however it still doesn't work.

Is there anything I am missing?

like image 841
Dan Avatar asked Nov 07 '13 10:11

Dan


1 Answers

Set your UIViewController subclass as the gestureRecognizer's delegate:

self.navigationController.interactivePopGestureRecognizer.delegate = self;

That's it!

like image 160
simonmaddox Avatar answered Dec 08 '22 00:12

simonmaddox