Skip to content

Commit

Permalink
Make the Instagram app compile again
Browse files Browse the repository at this point in the history
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
  • Loading branch information
martin-ortega authored and facebook-github-bot committed Sep 28, 2020
1 parent b85b4f4 commit 0a0d2c9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions React/Views/RCTDatePicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@

#import "RCTDatePicker.h"

#import <Availability.h>
#import <AvailabilityInternal.h>

#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;
Expand All @@ -25,9 +36,11 @@ - (instancetype)initWithFrame:(CGRect)frame
[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;
}
Expand Down

0 comments on commit 0a0d2c9

Please sign in to comment.