You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frameOfPresentedViewInContainerView is unfortunately only called during the initial presentation of a view controller, meaning a view controller that's presented over part of the screen won't know to update its layout when the device's orientation changes.
To solve this, we can implement viewWillTransitionToSize and invoke _calculateFrameOfPresentedView with the new dimensions. This will allow the block to return a new size for the new dimensions.
Unfortunately, some quick sleuthing revealed that the containerView's frame isn't up-to-date when viewWillTransitionToSize is invoked and, because our block implementations tend to look at the containerView's bounds, most of our layout blocks will probably be wrong.
frameOfPresentedViewInContainerViewis unfortunately only called during the initial presentation of a view controller, meaning a view controller that's presented over part of the screen won't know to update its layout when the device's orientation changes.To solve this, we can implement viewWillTransitionToSize and invoke
_calculateFrameOfPresentedViewwith the new dimensions. This will allow the block to return a new size for the new dimensions.Unfortunately, some quick sleuthing revealed that the
containerView's frame isn't up-to-date whenviewWillTransitionToSizeis invoked and, because our block implementations tend to look at the containerView's bounds, most of our layout blocks will probably be wrong.