6
votes

I have two view controllers, one of which pushes the other via the standard UINavigationController. The second view controller hides its navigation bar via navigationBarHidden. Hiding that bar seems to prevent the interactive pop gesture recognizer from working. I have a custom back button in the second screen, so for all intents and purposes it looks a lot like a navigation bar, only transparent, etc.

Is there a way that I can re-enable the interactive pop, while still keeping the navigation bar hidden on the second view controller, but showing on the first one? I’m admittedly not quite sure what the transition would be, but just wondering whether this has a simple solution.

2

2 Answers

0
votes

Suppose we have master and detail view controllers where detail view controller is the pushed view controller. Setting interactive pop gesture's delegate to nil at the master view controller enables interactive pop gesture working.

 self.navigationController?.interactivePopGestureRecognizer?.delegate = nil
-2
votes

This seems to work.

@implementation CustomNavigationController

- (void)viewDidLoad {

    [super viewDidLoad];

    [[self navigationBar] setHidden:YES];
}

@end

Tested on the 7.1 iOS simulator.