Resolve React-RCTText Xcode warning (#28054)
Summary: Resolve React-RCTText warning: `'UIKeyboardTypeASCIICapableNumberPad' is only available on iOS 10.0 or newer` ## Changelog [iOS] [Fixed] - Resolve React-RCTText Xcode warning Pull Request resolved: https://github.com/facebook/react-native/pull/28054 Test Plan: Build template, React-RCTText should no longer throw a warning. Differential Revision: D19887063 Pulled By: hramos fbshipit-source-id: 3437ee993babd7cdaec259af24526e197acb64bb
This commit is contained in:
Родитель
824e171117
Коммит
04fed6508b
|
@ -585,14 +585,25 @@ 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 =
|
||||
(
|
||||
keyboardType == UIKeyboardTypeNumberPad ||
|
||||
keyboardType == UIKeyboardTypePhonePad ||
|
||||
keyboardType == UIKeyboardTypeDecimalPad ||
|
||||
keyboardType == UIKeyboardTypeASCIICapableNumberPad
|
||||
) &&
|
||||
textInputView.returnKeyType == UIReturnKeyDone;
|
||||
BOOL shouldHaveInputAccesoryView;
|
||||
if (@available(iOS 10.0, *)) {
|
||||
shouldHaveInputAccesoryView =
|
||||
(
|
||||
keyboardType == UIKeyboardTypeNumberPad ||
|
||||
keyboardType == UIKeyboardTypePhonePad ||
|
||||
keyboardType == UIKeyboardTypeDecimalPad ||
|
||||
keyboardType == UIKeyboardTypeASCIICapableNumberPad
|
||||
) &&
|
||||
textInputView.returnKeyType == UIReturnKeyDone;
|
||||
} else {
|
||||
shouldHaveInputAccesoryView =
|
||||
(
|
||||
keyboardType == UIKeyboardTypeNumberPad ||
|
||||
keyboardType == UIKeyboardTypePhonePad ||
|
||||
keyboardType == UIKeyboardTypeDecimalPad
|
||||
) &&
|
||||
textInputView.returnKeyType == UIReturnKeyDone;
|
||||
}
|
||||
|
||||
if (_hasInputAccesoryView == shouldHaveInputAccesoryView) {
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче