From adb6929b3646985a582ce24d308db50e6af823db Mon Sep 17 00:00:00 2001 From: Hoa Dinh Date: Wed, 20 Jun 2018 09:50:29 -0700 Subject: [PATCH] Fixed build eats Reviewed By: skotchvail Differential Revision: D8529938 fbshipit-source-id: 6a97d2c54757d7e75fe8731efe24704cf7fdf87c --- React/Views/ScrollView/RCTScrollView.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/React/Views/ScrollView/RCTScrollView.m b/React/Views/ScrollView/RCTScrollView.m index f2d4da1ec..58661fa78 100644 --- a/React/Views/ScrollView/RCTScrollView.m +++ b/React/Views/ScrollView/RCTScrollView.m @@ -393,7 +393,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) // doesn't do weird things to UIScrollView insets automatically // and keeps it as an opt-in behavior. if ([_scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) { + if (@available(iOS 11.0, *)) { _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } } #endif @@ -1034,7 +1036,9 @@ RCT_SET_AND_PRESERVE_OFFSET(setScrollIndicatorInsets, scrollIndicatorInsets, UIE // `contentInsetAdjustmentBehavior` is available since iOS 11. if ([_scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) { CGPoint contentOffset = _scrollView.contentOffset; - _scrollView.contentInsetAdjustmentBehavior = behavior; + if (@available(iOS 11.0, *)) { + _scrollView.contentInsetAdjustmentBehavior = behavior; + } _scrollView.contentOffset = contentOffset; } }