Fixes iOS 7 and iOS 8 wrong size in viewWillAppear: while a a rotation is happening

This commit is contained in:
Michael Schneider
2016-07-19 14:04:23 -07:00
parent fceae5d2f8
commit 90d5c97d0f

View File

@@ -212,9 +212,20 @@ ASVisibilityDepthImplementation;
- (BOOL)_shouldLayoutTheLegacyWay
{
BOOL isModal = (self.presentingViewController != nil && self.presentedViewController == nil);
BOOL isModalViewController = (self.presentingViewController != nil && self.presentedViewController == nil);
BOOL hasNavigationController = (self.navigationController != nil);
BOOL hasParentViewController = (self.parentViewController != nil);
if (isModalViewController && !hasNavigationController && !hasParentViewController) {
return YES;
}
// Check if the view controller is a root view controller
BOOL isRootViewController = self.view.window.rootViewController == self;
return isModal || isRootViewController;
if (isRootViewController) {
return YES;
}
return NO;
}
- (ASSizeRange)_legacyConstrainedSize