From ae8d39e755e1ebf2c95270f70f17296cd7d4e822 Mon Sep 17 00:00:00 2001 From: Kacper Kafara Date: Tue, 1 Aug 2023 10:51:34 +0200 Subject: [PATCH] Add some more debug-logging and use v5 in TE example --- TestsExample/src/Test1775.tsx | 11 ++++++----- ios/RNSScreen.mm | 8 ++++++++ ios/UIViewController+RNScreens.mm | 5 +++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/TestsExample/src/Test1775.tsx b/TestsExample/src/Test1775.tsx index 95911700f3..918caadedb 100644 --- a/TestsExample/src/Test1775.tsx +++ b/TestsExample/src/Test1775.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import { View, Button } from 'react-native'; -import { createNativeStackNavigator } from '@react-navigation/native-stack'; +// import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from 'react-native-screens/native-stack'; import { NavigationContainer, ParamListBase } from '@react-navigation/native'; import { NativeStackNavigationProp } from 'react-native-screens/native-stack'; @@ -19,16 +20,16 @@ function App() { diff --git a/ios/RNSScreen.mm b/ios/RNSScreen.mm index 61446fe2af..cbe0ad7e06 100644 --- a/ios/RNSScreen.mm +++ b/ios/RNSScreen.mm @@ -769,6 +769,9 @@ - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask - (void)didSetProps:(NSArray *)changedProps { [super didSetProps:changedProps]; + if ([changedProps containsObject:@"stackPresentation"]) { + NSLog(@"RNSScreen %p has set stackPresentation to: %ld", self.controller, self.stackPresentation); + } #if !TARGET_OS_TV [self updatePresentationStyle]; #endif // !TARGET_OS_TV @@ -1071,6 +1074,11 @@ - (UIViewController *)findChildVCForConfigAndTrait:(RNSWindowTrait)trait includi if (modalScreen.screenView.stackPresentation == RNSScreenStackPresentationFullScreenModal) { NSLog(@"RNSScreen %p presented another screen with full screen stack presentation", self); return self; + } else { + NSLog( + @"RNSScreen %p presented another screen with stack presentation OTHER than full screen: %ld", + self, + modalScreen.screenView.stackPresentation); } // we don't want to allow controlling of status bar appearance when we present non-fullScreen modal // and it is not possible if `modalPresentationCapturesStatusBarAppearance` is not set to YES, so even diff --git a/ios/UIViewController+RNScreens.mm b/ios/UIViewController+RNScreens.mm index 1c230c263e..9a913e1887 100644 --- a/ios/UIViewController+RNScreens.mm +++ b/ios/UIViewController+RNScreens.mm @@ -32,12 +32,13 @@ - (UIInterfaceOrientationMask)reactNativeScreensSupportedInterfaceOrientations if (childVC != nil) { UIInterfaceOrientationMask mask = childVC.supportedInterfaceOrientations; NSLog( - @"UIVC + RNS: found child VC for supported interface orientations: %@, with orientation mask %ld", + @"UIVC + RNS %p found child VC for supported interface orientations: %@, with orientation mask %ld", + self, childVC, mask); return mask; } else { - NSLog(@"UIVC + RNS: did NOT found child VC for supported interface orientations"); + NSLog(@"UIVC + RNS %p did NOT found child VC for supported interface orientations", self); return [self reactNativeScreensSupportedInterfaceOrientations]; }