Move check for iOS 9 from an early return to an earlier check to prevent objc_msgSend

This commit is contained in:
Michael Schneider
2016-07-14 14:50:54 -07:00
parent 6e8772a68d
commit cd46791f9d

View File

@@ -88,7 +88,9 @@
[super viewWillLayoutSubviews];
[_node measureWithSizeRange:[self nodeConstrainedSize]];
[self _legacyHandleViewDidLayoutSubviewsIfNecessary];
if (!AS_AT_LEAST_IOS9) {
[self _legacyHandleViewDidLayoutSubviews];
}
}
- (void)viewDidLayoutSubviews
@@ -214,12 +216,8 @@ ASVisibilityDepthImplementation;
return ASSizeRangeMake(viewSize, viewSize);
}
- (void)_legacyHandleViewDidLayoutSubviewsIfNecessary
- (void)_legacyHandleViewDidLayoutSubviews
{
if (AS_AT_LEAST_IOS9) {
return;
}
// In modal presentation or as root viw controller the view does not automatic resize in iOS7 and iOS8.
// As workaround we adjust the frame of the view manually
if ([self _shouldLayoutTheLegacyWay]) {