Hardcode @available(iOS 10) to YES

Summary:
RN removed support for iOS 9 last year, therefore iOS10+ is always available.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D22655069

fbshipit-source-id: 77e85e0403ea7ea0febc8766c10bb6f94ea417ad
This commit is contained in:
Peter Argany
2020-07-22 11:00:32 -07:00
committed by Facebook GitHub Bot
parent 4409642811
commit 91d16bbd9f
4 changed files with 5 additions and 31 deletions
+1 -7
View File
@@ -185,14 +185,8 @@ static NSUInteger RCTDeviceFreeMemory() {
#else
// displaylink.duration -- time interval between frames, assuming maximumFramesPerSecond
// displayLink.preferredFramesPerSecond (>= iOS 10) -- Set to 30 for displayDidRefresh to be called at 30 fps
// displayLink.frameInterval (< iOS 10) -- # of frames that must pass before each displayDidRefresh. After iOS 10, when this is set to 2, preferredFramesPerSecond becomes 30 fps.
// durationToNextRefresh -- Time interval to the next time displayDidRefresh is called
NSTimeInterval durationToNextRefresh;
if (@available(iOS 10.0, *)) {
durationToNextRefresh = displayLink.targetTimestamp - displayLink.timestamp;
} else {
durationToNextRefresh = displayLink.duration * displayLink.frameInterval;
}
NSTimeInterval durationToNextRefresh = displayLink.targetTimestamp - displayLink.timestamp;
#endif
NSUInteger totalFrameCount = self.totalFrameCount;
NSUInteger currentFrameIndex = self.currentFrameIndex;
@@ -596,9 +596,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
// These keyboard types (all are number pads) don't have a "Done" button by default,
// so we create an `inputAccessoryView` with this button for them.
BOOL shouldHaveInputAccesoryView;
if (@available(iOS 10.0, *)) {
shouldHaveInputAccesoryView =
BOOL shouldHaveInputAccesoryView =
(
keyboardType == UIKeyboardTypeNumberPad ||
keyboardType == UIKeyboardTypePhonePad ||
@@ -606,15 +604,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
keyboardType == UIKeyboardTypeASCIICapableNumberPad
) &&
textInputView.returnKeyType == UIReturnKeyDone;
} else {
shouldHaveInputAccesoryView =
(
keyboardType == UIKeyboardTypeNumberPad ||
keyboardType == UIKeyboardTypePhonePad ||
keyboardType == UIKeyboardTypeDecimalPad
) &&
textInputView.returnKeyType == UIReturnKeyDone;
}
if (_hasInputAccesoryView == shouldHaveInputAccesoryView) {
return;
@@ -174,9 +174,7 @@ using namespace facebook::react;
}
if (newTextInputProps.traits.textContentType != oldTextInputProps.traits.textContentType) {
if (@available(iOS 10.0, *)) {
_backedTextInputView.textContentType = RCTUITextContentTypeFromString(newTextInputProps.traits.textContentType);
}
_backedTextInputView.textContentType = RCTUITextContentTypeFromString(newTextInputProps.traits.textContentType);
}
if (newTextInputProps.traits.passwordRules != oldTextInputProps.traits.passwordRules) {
@@ -42,10 +42,7 @@ void RCTCopyBackedTextInput(
toTextInput.scrollEnabled = fromTextInput.scrollEnabled;
toTextInput.secureTextEntry = fromTextInput.secureTextEntry;
toTextInput.keyboardType = fromTextInput.keyboardType;
if (@available(iOS 10.0, *)) {
toTextInput.textContentType = fromTextInput.textContentType;
}
toTextInput.textContentType = fromTextInput.textContentType;
if (@available(iOS 12.0, *)) {
toTextInput.passwordRules = fromTextInput.passwordRules;
@@ -138,11 +135,7 @@ UIKeyboardType RCTUIKeyboardTypeFromKeyboardType(KeyboardType keyboardType)
case KeyboardType::WebSearch:
return UIKeyboardTypeWebSearch;
case KeyboardType::ASCIICapableNumberPad:
if (@available(iOS 10.0, *)) {
return UIKeyboardTypeASCIICapableNumberPad;
} else {
return UIKeyboardTypeNumberPad;
}
return UIKeyboardTypeASCIICapableNumberPad;
// Android-only
case KeyboardType::VisiblePassword:
return UIKeyboardTypeDefault;