Fix duplicate [RCTConvert UIUserInterfaceStyle:]

Summary:
After https://github.com/facebook/react-native/pull/36122 we have two of these. This change consolidates the two category methods to be part of the base RCTConvert class instead.

Changelog:
[iOS][Fixed] - Fix duplicate [RCTConvert UIUserInterfaceStyle:]

Reviewed By: cipolleschi

Differential Revision: D44050929

fbshipit-source-id: dd216545e6194446c593cd693072f3959d653d7f
This commit is contained in:
Nick Gerleman
2023-03-14 09:30:07 -07:00
committed by Facebook GitHub Bot
parent 01f2936de1
commit d8b4737ca6
4 changed files with 11 additions and 28 deletions
+1
View File
@@ -71,6 +71,7 @@ typedef NSURL RCTFileURL;
+ (UIKeyboardType)UIKeyboardType:(id)json;
+ (UIKeyboardAppearance)UIKeyboardAppearance:(id)json;
+ (UIReturnKeyType)UIReturnKeyType:(id)json;
+ (UIUserInterfaceStyle)UIUserInterfaceStyle:(id)json API_AVAILABLE(ios(12));
#if !TARGET_OS_TV
+ (UIDataDetectorTypes)UIDataDetectorTypes:(id)json;
#endif
+10
View File
@@ -501,6 +501,16 @@ RCT_ENUM_CONVERTER(
UIReturnKeyDefault,
integerValue)
RCT_ENUM_CONVERTER(
UIUserInterfaceStyle,
(@{
@"unspecified" : @(UIUserInterfaceStyleUnspecified),
@"light" : @(UIUserInterfaceStyleLight),
@"dark" : @(UIUserInterfaceStyleDark),
}),
UIUserInterfaceStyleUnspecified,
integerValue)
RCT_ENUM_CONVERTER(
UIViewContentMode,
(@{
-14
View File
@@ -32,20 +32,6 @@ RCT_ENUM_CONVERTER(
@end
@implementation RCTConvert (UIUserInterfaceStyle)
RCT_ENUM_CONVERTER(
UIUserInterfaceStyle,
(@{
@"unspecified" : @(UIUserInterfaceStyleUnspecified),
@"light" : @(UIUserInterfaceStyleLight),
@"dark" : @(UIUserInterfaceStyleDark),
}),
UIUserInterfaceStyleUnspecified,
integerValue)
@end
@interface RCTAlertManager () <NativeAlertManagerSpec>
@end
-14
View File
@@ -69,20 +69,6 @@ NSString *RCTColorSchemePreference(UITraitCollection *traitCollection)
return RCTAppearanceColorSchemeLight;
}
@implementation RCTConvert (UIUserInterfaceStyle)
RCT_ENUM_CONVERTER(
UIUserInterfaceStyle,
(@{
@"light" : @(UIUserInterfaceStyleLight),
@"dark" : @(UIUserInterfaceStyleDark),
@"unspecified" : @(UIUserInterfaceStyleUnspecified)
}),
UIUserInterfaceStyleUnspecified,
integerValue);
@end
@interface RCTAppearance () <NativeAppearanceSpec>
@end