Skip to content

Commit

Permalink
Back out "Enable Multiple Sheet Presentation in React Native" (#46433)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46433

Original commit changeset: 53667cf1a75e

Original Phabricator Diff: D62143463

Changelog: [Internal]  revert previous modal presentation improvement

Reviewed By: sammy-SC

Differential Revision: D62474039

fbshipit-source-id: b510c0460c06ab9d595d414d4ea32acd224871bc
  • Loading branch information
Mohamed Alsadek authored and facebook-github-bot committed Sep 11, 2024
1 parent 080c82e commit b3f4d54
Showing 1 changed file with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ - (void)presentViewController:(UIViewController *)modalViewController
completion:(void (^)(void))completion
{
UIViewController *controller = [self reactViewController];
[[self _topMostViewControllerFrom:controller] presentViewController:modalViewController
animated:animated
completion:completion];
[controller presentViewController:modalViewController animated:animated completion:completion];
}

- (void)dismissViewController:(UIViewController *)modalViewController
Expand Down Expand Up @@ -276,26 +274,6 @@ - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childCompo
[childComponentView removeFromSuperview];
}

#pragma mark - Private

- (UIViewController *)_topMostViewControllerFrom:(UIViewController *)rootViewController
{
UIViewController *topController = rootViewController;
while (topController.presentedViewController) {
topController = topController.presentedViewController;
}
if ([topController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navigationController = (UINavigationController *)topController;
topController = navigationController.visibleViewController;
return [self _topMostViewControllerFrom:topController];
} else if ([topController isKindOfClass:[UITabBarController class]]) {
UITabBarController *tabBarController = (UITabBarController *)topController;
topController = tabBarController.selectedViewController;
return [self _topMostViewControllerFrom:topController];
}
return topController;
}

@end

#ifdef __cplusplus
Expand Down

0 comments on commit b3f4d54

Please sign in to comment.