I need to reconfigure the size of the UINavigationController
inside my UITabController
. This works fine when the view loads, in viewWillAppear()
. However, when I try to resize in viewWillDisappear
, I get nil values for both the Nav/Tab controller. Example:
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.hidesBarsOnSwipe = false //po self.navigationController --> nil
...
var smallerFrame: CGRect = (self.tabBarController?.view.frame)!; //po self.tabBarController --> nil
...
}
I'm not sure what's going on. Why would this happen in viewWillDisappear
but not viewWillAppear
?
I had the same problem. Ended up setting a weak property to navigation controller in viewDidLoad.
@property(weak, nonatomic) UINavigationController *weakNavigationController;
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