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; }