Zss1990 opened a new issue #152:
URL: https://github.com/apache/cordova-plugin-wkwebview-engine/issues/152
# Bug Report
报错```Attempt to present <UIAlertController: 0x7f8d50193c00> on
<UINavigationController: 0x7f8d4f022000> whose view is not in the window
hierarchy!```
## Problem
当我presentViewController出来一个WXBaseViewController时候,进行alert弹框会报错
报错```Attempt to present <UIAlertController: 0x7f8d50193c00> on
<UINavigationController: 0x7f8d4f022000> whose view is not in the window
hierarchy!```
### What is expected to happen?
在类CDVWKWebViewUIDelegate中
```
UIViewController* rootController = [UIApplication
sharedApplication].delegate.window.rootViewController;
[rootController presentViewController:alert animated:YES completion:nil];
```
会有问题,
是否考虑修改为
```
UIViewController* rootController = [UIApplication
sharedApplication].delegate.window.rootViewController;
if ([rootController isKindOfClass:[UINavigationController class]]) {
rootController = [(UINavigationController *)rootController
visibleViewController];
}
[rootController presentViewController:alert animated:YES completion:nil];
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]