From cd46791f9d2d3bc90ccdbc6da6b4bf3ae808fe57 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Thu, 14 Jul 2016 14:50:54 -0700 Subject: [PATCH] Move check for iOS 9 from an early return to an earlier check to prevent objc_msgSend --- AsyncDisplayKit/ASViewController.mm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/AsyncDisplayKit/ASViewController.mm b/AsyncDisplayKit/ASViewController.mm index d18621942c..cef7753c83 100644 --- a/AsyncDisplayKit/ASViewController.mm +++ b/AsyncDisplayKit/ASViewController.mm @@ -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]) {