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

WKWebview fail to open WKActionsSheet on presented UINavigationController

我的 WKWebViewController 有问题。

我用这段代码来呈现:

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

显示正确,但是当我按任何 link 时,出现此错误:

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

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

提前致谢

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

我们已经在 PSPDFKit 中看到了这个问题,在调查了 UIKit 程序集和 WKWebView 来源之后,我们发现了一个仍然很糟糕但不是侵入性的解决方法。

主要策略是有选择地及时应用解决方法 - 然后再次清理。您可以在这里阅读源代码:

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

请欺骗 rdar://26295020,这样这有望在 iOS 10 时得到及时修复。(该错误自 iOS 8 以来就存在,并首次报告于 iOS 8b5.)