From 1f1127abc35288a296e9b68c206a622a4cbcf8bd Mon Sep 17 00:00:00 2001 From: Vijay Vikram Singh Date: Wed, 10 Feb 2021 06:31:06 -0800 Subject: [PATCH] fix(ios): use supportedInterfaceOrientations of UINavigationController.topViewController instead of UINavigationController (#12458) Fixes TIMOB-28282 --- .../TitaniumKit/TitaniumKit/Sources/API/TiViewController.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewController.m b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewController.m index c6dfd049291..0bfb5566251 100644 --- a/iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewController.m +++ b/iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewController.m @@ -104,8 +104,11 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations If we are in a navigation controller, let us match so it doesn't get freaked out in when pushing/popping. We are going to force orientation anyways. */ - if ([self navigationController] != nil) { - return [[self navigationController] supportedInterfaceOrientations]; + /* + TIMOB-28282. Shouldn't UINavigationController.topViewController decide the supported orientation? + */ + if ([self navigationController] != nil && [[self navigationController] topViewController] != self) { + return [[[self navigationController] topViewController] supportedInterfaceOrientations]; } //This would be for modal. return (UIInterfaceOrientationMask)_supportedOrientations;