When using UINavigationController
and pushing view controllers, you'll often want to use a custom back button by implementing your own custom view (usually a UIButton
) and assigning it to the navigation item's leftBarButtonItem
property. Or you might just want to keep the default back button and want to do something additional when user taps back, such as playing a sound effect by implementing -navigationController:animationControllerForOperation:fromViewController:toViewController:
of UINavigationControllerDelegate
. In iOS 7, you'll find that both approaches still work except that the default swipe right from left edge of screen gesture to go back stops working. All you need to do is the following to fix it:
UINavigationController* nc;
//something
nc.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
You don't have to implement any methods from the UIGestureRecognizerDelegate
protocol.
Your feedback is valuable: Do you want more nuggets like this? Yes or No
.