diff --git a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.h b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.h index b92bc1ec9c3209..eff3b0c5461422 100644 --- a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.h +++ b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.h @@ -5,11 +5,9 @@ * LICENSE file in the root directory of this source tree. */ +#import #import -#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 12000) /* __IPHONE_12_0 */ #import -#endif -#import @interface RCTLinkingManager : RCTEventEmitter @@ -24,11 +22,6 @@ + (BOOL)application:(nonnull UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity - restorationHandler: -#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 12000) /* __IPHONE_12_0 */ - (nonnull void (^)(NSArray> *_Nullable))restorationHandler; -#else - (nonnull void (^)(NSArray *_Nullable))restorationHandler; -#endif + restorationHandler:(nonnull void (^)(NSArray> *_Nullable))restorationHandler; @end diff --git a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm index cfa9078446208d..3fa06c43979bfd 100644 --- a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm +++ b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm @@ -72,14 +72,8 @@ + (BOOL)application:(UIApplication *)application + (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler: -#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 12000) /* __IPHONE_12_0 */ - (nonnull void (^)(NSArray> *_Nullable))restorationHandler + restorationHandler:(nonnull void (^)(NSArray> *_Nullable))restorationHandler { -#else - (nonnull void (^)(NSArray *_Nullable))restorationHandler -{ -#endif if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) { NSDictionary *payload = @{@"url" : userActivity.webpageURL.absoluteString}; [[NSNotificationCenter defaultCenter] postNotificationName:kOpenURLNotification object:self userInfo:payload]; diff --git a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.m b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.m index 9da656c5b0fb95..cb293db64411b4 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -231,7 +231,6 @@ - (void)setSelectionStart:(NSInteger)start selectionEnd:(NSInteger)end - (void)setTextContentType:(NSString *)type { -#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) static dispatch_once_t onceToken; static NSDictionary *contentTypeMap; @@ -263,21 +262,14 @@ - (void)setTextContentType:(NSString *)type @"telephoneNumber" : UITextContentTypeTelephoneNumber, @"username" : UITextContentTypeUsername, @"password" : UITextContentTypePassword, + @"newPassword" : UITextContentTypeNewPassword, + @"oneTimeCode" : UITextContentTypeOneTimeCode, }; - - NSDictionary *iOS12extras = - @{@"newPassword" : UITextContentTypeNewPassword, @"oneTimeCode" : UITextContentTypeOneTimeCode}; - - NSMutableDictionary *iOS12baseMap = [contentTypeMap mutableCopy]; - [iOS12baseMap addEntriesFromDictionary:iOS12extras]; - - contentTypeMap = [iOS12baseMap copy]; }); // Setting textContentType to an empty string will disable any // default behaviour, like the autofill bar for password inputs self.backedTextInputView.textContentType = contentTypeMap[type] ?: type; -#endif } - (void)setPasswordRules:(NSString *)descriptor diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 54f9bbf0e2c700..b1af0851edae33 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -182,10 +182,8 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & } if (newTextInputProps.traits.smartInsertDelete != oldTextInputProps.traits.smartInsertDelete) { - if (@available(iOS 11.0, *)) { - _backedTextInputView.smartInsertDeleteType = - RCTUITextSmartInsertDeleteTypeFromOptionalBool(newTextInputProps.traits.smartInsertDelete); - } + _backedTextInputView.smartInsertDeleteType = + RCTUITextSmartInsertDeleteTypeFromOptionalBool(newTextInputProps.traits.smartInsertDelete); } // Traits `blurOnSubmit`, `clearTextOnFocus`, and `selectTextOnFocus` were omitted intentionally here diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm index a79ddff152fa91..06862324203e10 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm @@ -43,11 +43,7 @@ void RCTCopyBackedTextInput( toTextInput.secureTextEntry = fromTextInput.secureTextEntry; toTextInput.keyboardType = fromTextInput.keyboardType; toTextInput.textContentType = fromTextInput.textContentType; - - if (@available(iOS 11.0, *)) { - toTextInput.smartInsertDeleteType = fromTextInput.smartInsertDeleteType; - } - + toTextInput.smartInsertDeleteType = fromTextInput.smartInsertDeleteType; toTextInput.passwordRules = fromTextInput.passwordRules; [toTextInput setSelectedTextRange:fromTextInput.selectedTextRange notifyDelegate:NO]; @@ -185,7 +181,7 @@ UITextContentType RCTUITextContentTypeFromString(std::string const &contentType) static NSDictionary *contentTypeMap; dispatch_once(&onceToken, ^{ - NSMutableDictionary *mutableContentTypeMap = [@{ + contentTypeMap = @{ @"" : @"", @"none" : @"", @"URL" : UITextContentTypeURL, @@ -213,14 +209,9 @@ UITextContentType RCTUITextContentTypeFromString(std::string const &contentType) @"telephoneNumber" : UITextContentTypeTelephoneNumber, @"username" : UITextContentTypeUsername, @"password" : UITextContentTypePassword, - } mutableCopy]; - - [mutableContentTypeMap addEntriesFromDictionary:@{ @"newPassword" : UITextContentTypeNewPassword, - @"oneTimeCode" : UITextContentTypeOneTimeCode - }]; - - contentTypeMap = [mutableContentTypeMap copy]; + @"oneTimeCode" : UITextContentTypeOneTimeCode, + }; }); return contentTypeMap[RCTNSStringFromString(contentType)] ?: @"";