I'm implementing a container view controller where a part of the screen is a view containing an UINavigationController
view. My viewDidLoad:
is something like this:
// ...
UIViewController *myNavigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"MyNavigationController"];
[self addChildViewController:myNavigationController];
[self.myContainerView addSubview:myNavigationController.view];
[myNavigationController didMoveToParentViewController:self];
// ...
No problems with rotations, and pushing new view controllers into the navigation controller works fine. But when the user taps on the Back UIBarButtonItem
, not just self.myContainerView
but the whole self.view
animates upwards, similar to kCATransitionFromBottom
, instead of the normal navigation controller pop animation. After a few more debugging I realized that my view controller's viewWillDisappear:
and viewWillAppear:
methods are getting called when popping from myNavigationController
.
Unfortunately, I'm stuck. I'll appreciate if anyone can give an idea what's going and how to work around this.
Edit:
OK nevermind. I forgot to implement shouldAutorotateToInterfaceOrientation:
in one of my navigation controller's children. returning YES
fixed the problem.
OK nevermind. I forgot to implement shouldAutorotateToInterfaceOrientation: in one of my navigation controller's children. returning YES fixed the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With