I present a view controller from another one:
- (void)showModalView
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
MySecViewController *mySecViewController = [storyboard instantiateViewControllerWithIdentifier:@"secController"];
mySecViewController.delegate = self;
[self presentViewController:mySecViewController animated:YES completion:nil];
}
Then in the presented UIViewController
, the method viewWillTransitionToSize:withTransitionCoordinator:
is called in iOS 8
but not in iOS 9
...
Thanks
In your current view controller, if you override viewWillTransitionToSize:withTransitionCoordinator:
, make sure you call super
. Otherwise, this message won't get propagated to children view controllers.
For Objective-C:
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
// Your other code ...
And Swift:
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
// Your other code ...
}