When animateTransition
is called on the transitioning delegate the Safe Area Insets have yet to be set on the \'to view controller\'.
I\'ve tried forci
Ensure that the destination view controller is actually in the view hierarchy when you call layoutIfNeeded
. I had this same problem, oddly only affecting certain orientations, and fixed it by adding the second and third lines below:
UIViewController * toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
// Added these two lines:
toViewController.view.frame = [transitionContext finalFrameForViewController:toViewController];
[transitionContext.containerView addSubview:toViewController.view];
[toViewController.view setNeedsLayout];
[toViewController.view layoutIfNeeded];