From 0a0d2c990d6b666c962ca3a513f5fdb74eb79e0a Mon Sep 17 00:00:00 2001 From: Martin Ortega Date: Mon, 28 Sep 2020 12:33:57 -0700 Subject: [PATCH] Make the Instagram app compile again Summary: Wrap iOS 14 SDK code in a `#if/#endif` so that the Instagram app compiles again Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D23948336 fbshipit-source-id: 67e6ee48d1951ae405c12b4ad39cf8c9817df627 --- React/Views/RCTDatePicker.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/React/Views/RCTDatePicker.m b/React/Views/RCTDatePicker.m index 3ba934d152..9fee82b3cf 100644 --- a/React/Views/RCTDatePicker.m +++ b/React/Views/RCTDatePicker.m @@ -7,9 +7,20 @@ #import "RCTDatePicker.h" +#import +#import + #import "RCTUtils.h" #import "UIView+React.h" +#ifndef __IPHONE_14_0 + #define __IPHONE_14_0 140000 +#endif // __IPHONE_14_0 + +#ifndef RCT_IOS_14_0_SDK_OR_LATER + #define RCT_IOS_14_0_SDK_OR_LATER (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0) +#endif // RCT_IOS_14_0_SDK_OR_LATER + @interface RCTDatePicker () @property (nonatomic, copy) RCTBubblingEventBlock onChange; @@ -25,9 +36,11 @@ [self addTarget:self action:@selector(didChange) forControlEvents:UIControlEventValueChanged]; _reactMinuteInterval = 1; +#if RCT_IOS_14_0_SDK_OR_LATER if (@available(iOS 14, *)) { self.preferredDatePickerStyle = UIDatePickerStyleWheels; } +#endif // RCT_IOS_14_0_SDK_OR_LATER } return self; }