From 2ab750f7bbcfcc81714054cabb574442f33298bf Mon Sep 17 00:00:00 2001 From: Enrico Bern Hardy Tanuwidjaja Date: Fri, 31 Mar 2023 14:06:28 -0700 Subject: [PATCH] Changing tab bar controller orientation to portrait Summary: Applying orientation from navigationOptions to the TabBarController ## Changelog [iOS][Added] - Added conversion helper for UIInterfaceOrientationMask to RCTConvert Reviewed By: philIip Differential Revision: D44553533 fbshipit-source-id: e57c68c56f1184346bf02f5a915d7722660902ff --- packages/react-native/React/Base/RCTConvert.h | 2 ++ packages/react-native/React/Base/RCTConvert.m | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/react-native/React/Base/RCTConvert.h b/packages/react-native/React/Base/RCTConvert.h index abb59d161804fa..5b4559d94b1224 100644 --- a/packages/react-native/React/Base/RCTConvert.h +++ b/packages/react-native/React/Base/RCTConvert.h @@ -72,6 +72,8 @@ typedef NSURL RCTFileURL; + (UIKeyboardAppearance)UIKeyboardAppearance:(id)json; + (UIReturnKeyType)UIReturnKeyType:(id)json; + (UIUserInterfaceStyle)UIUserInterfaceStyle:(id)json API_AVAILABLE(ios(12)); ++ (UIInterfaceOrientationMask)UIInterfaceOrientationMask:(NSString *)orientation; + #if !TARGET_OS_TV + (UIDataDetectorTypes)UIDataDetectorTypes:(id)json; #endif diff --git a/packages/react-native/React/Base/RCTConvert.m b/packages/react-native/React/Base/RCTConvert.m index ce12ccd3cc961b..c5cb77a16f24a1 100644 --- a/packages/react-native/React/Base/RCTConvert.m +++ b/packages/react-native/React/Base/RCTConvert.m @@ -511,6 +511,18 @@ + (UIKeyboardType)UIKeyboardType:(id)json RCT_DYNAMIC UIUserInterfaceStyleUnspecified, integerValue) +RCT_ENUM_CONVERTER( + UIInterfaceOrientationMask, + (@{ + @"ALL" : @(UIInterfaceOrientationMaskAll), + @"PORTRAIT" : @(UIInterfaceOrientationMaskPortrait), + @"LANDSCAPE" : @(UIInterfaceOrientationMaskLandscape), + @"LANDSCAPE_LEFT" : @(UIInterfaceOrientationMaskLandscapeLeft), + @"LANDSCAPE_RIGHT" : @(UIInterfaceOrientationMaskLandscapeRight), + }), + NSNotFound, + unsignedIntegerValue) + RCT_ENUM_CONVERTER( UIViewContentMode, (@{