I have a UITabBarController
which has few tabs. When I change orientation of the app, in iOS 8, All of it's viewController's viewDidLoad
get called. This is not happening when I run the app in iOS 7.
Is it any new functionality of iOS 8 that reload UITabBarController
on orientation change?
If so How can I prevent my Tabbar to reload it's view controller.
I had the same problem. I noticed that on iOS8 when the orientation of the device is changing viewWillTransitionToSize:withTransitionCoordinator: is getting called on UITabBarController, and UITabBarController calls viewDidLoad method of any viewcontroller that has not been loaded yet.
For now,in my UITabBarController subclass I override this method to not call [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator].
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
//Do not call [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
NSLog(@"Device orinetation changed");
}
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