Skip to content

Commit

Permalink
fix(ios): hierarchy error when using SplitWindow and NavigationWindow
Browse files Browse the repository at this point in the history
Fixes TIMOB-28497
  • Loading branch information
jquick-axway authored and ewanharris committed Jul 20, 2021
1 parent 743475a commit 8e5b149
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiWindowProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,20 @@ - (UIViewController *)hostingController;

- (UIViewController *)windowHoldingController
{
// Use assigned controller if set.
if (controller != nil) {
return controller;
} else {
return [[TiApp app] controller];
}

// Walk up the view hierarchy for the 1st controller available.
for (UIResponder *responder = [self view].nextResponder; responder != nil; responder = responder.nextResponder) {
if ([responder isKindOfClass:[UIViewController class]]) {
return (UIViewController *)responder;
}
}

// Fallback to the app's root view controller.
return [[TiApp app] controller];
}

#pragma mark - Private Methods
Expand Down

0 comments on commit 8e5b149

Please sign in to comment.