I am doing custom push transition from controller A to controller B. In Controller A, navbar is hidden but it is visible in Controller B. When I am doing the custom transition, navigation bar immediately appears at the beginning of the transition. How can I prevent this?
Here are some code pieces:
In controller A, navigation bar is hidden with following code:
- (void)viewWillAppear:(BOOL)animated
{
[self.navigationController setNavigationBarHidden:YES animated:NO];
[super viewWillAppear:animated];
}
Also, in controller A, I am starting the custom push transition with following code:
{
...
NOZViewController *vc = (NOZViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@"gameController"];
[self.navigationController pushViewController:vc animated:YES ];
}
As soon as the custom transition starts, I see the navigation bar of controller B! Here is how I get the snapshots for custom animation code for transition:
{
...
NOZMainViewController *fromViewCtrl =
(NOZMainViewController *)[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIView *fromSnapshot = [fromViewCtrl.view snapshotViewAfterScreenUpdates:NO];
NOZViewController *toViewCtrl =
(NOZViewController *)[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
UIView *toViewSnapshot = [toViewCtrl.view snapshotViewAfterScreenUpdates:YES];
....
}