Use the below code if you want to hide and unhide the navigation bar on double tap on any part of the view
In your .h file:
IBOutlet UINavigationController *navigationController;
Connect the IBOutlet in your XIB.
in your .m file:
-(void)viewDidLoad {
[super viewDidLoad];
[navigationController setNavigationBarHidden:YES];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject];
if (touch.tapCount == 2) {
[navigationController setNavigationBarHidden:NO];
[NSTimer scheduledTimerWithTimeInterval:(1.0) target:self selector:@selector(hideBar) userInfo:nil repeats:NO];
}
}
-(void)hidebar{
[navigationController setNavigationBarHidden:YES];
}
Do the modifications as per your requirement.
Happy coding!