I present a view controller from another one:
- (void)showModalView
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@\"Main\" bundle:nil];
Maybe it's a little late, but I put this here for anyone stumbling upon this frustrating issue.
Keep in mind that viewWillTransitionToSize:withTransitionCoordinator:
sometimes gets called on the presentingViewController
of the view controller you are expecting it to. (And if that view controller has a presentingViewController
too, it may get called on that)
I couldn't really figure out the logic behind this, but that was the point in my case. So I had to override viewWillTransitionToSize:withTransitionCoordinator:
in many of my view controllers like this:
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator {
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[self.presentedViewController viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}