Skip to content
Permalink
Browse files
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: #28054

Test Plan: Build template, React-RCTText should no longer throw a warning.

Differential Revision: D19887063

Pulled By: hramos

fbshipit-source-id: 3437ee993babd7cdaec259af24526e197acb64bb
  • Loading branch information
safaiyeh authored and facebook-github-bot committed Feb 13, 2020
1 parent 824e171 commit 04fed6508b74b23c954183af3f6121fb344d2138
Showing 1 changed file with 19 additions and 8 deletions.
@@ -585,14 +585,25 @@ - (void)setDefaultInputAccessoryView

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

0 comments on commit 04fed65

Please sign in to comment.