在 React Native 项目中,我想从 iOS npm 模块访问 Presented Viewcontroller。我可以使用下面的代码访问 RN 项目的 rootviewcontroller
UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController;
Run Code Online (Sandbox Code Playgroud)
但我希望当前的 VC 呈现在 RootVC 之上,以便我应该能够在其之上呈现本机(iOS)UINavigationController。
注意:[UIApplication sharedApplication].delegate.window.rootViewController.presentedViewController返回零。