ios – WKWebview无法在呈现的UINavigationController上打开WKActionsSheet

前端之家收集整理的这篇文章主要介绍了ios – WKWebview无法在呈现的UINavigationController上打开WKActionsSheet前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我的WKWebViewController有问题.

我用这段代码来表示:

SRWebWKViewController *webcontroller = [self.storyboard instantiateViewControllerWithIdentifier:@"SRWebViewControllerWKWebview"];
    UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:webcontroller];
    [self presentViewController:navController animated:YES completion:nil];

显示正确,但当我按任何链接时,我收到此错误

Warning: Attempt to present <WKActionSheet: 0x7fc4f4c6f5e0> on <UINavigationController: 0x7fc4f4b9d9e0> whose view is not in the window hierarchy!

我在网上搜索了很多,但我找不到解决问题的任何解决方

提前致谢

解决方法

这是UIKit从iOS 8.0到至少iOS 9.3.1的一个错误.

我们在PSPDFKit中已经看到过这个问题,在调查了UIKit组件和WKWebView源之后,我们发现了一个仍然很糟糕但不具有侵入性的解决方法.

主要策略是选择性并及时应用解决方法 – 然后再次清理.你可以在这里阅读源代码

https://gist.github.com/steipete/b00fc02aa9f1c66c11d0f996b1ba1265

请注意0​​7002,这样就可以及时修复iOS 10.(该漏洞自iOS 8开始存在,并且首次在iOS 8b5上报告.)

猜你在找的Xcode相关文章