首页 > 解决方案 > 似乎无法将 UIWebView 升级到 WKWebView

问题描述

我目前正在尝试将 Objective C 中的 IOS 应用程序从 UIWebView 升级到 WKWebView。到目前为止我没有运气。

该应用程序当前需要使用 JSBridge,它仍然使用 UIWebView。

我已经尝试遵循多个指南,手动将所有内容替换为 WkWebView(无论我修复多少,这都会给我带来大量错误),用新的 JSBridge 库重新导入,但我仍然会遇到许多错误,包括弃用错误。

一些错误包括:

Assigning to 'id<WKNavigationDelegate> _Nullable' from incompatible type 'ModalViewController *const __strong'

Implicit conversion from enumeration type 'WKNavigationType' (aka 'enum WKNavigationType') to different enumeration type 'UIWebViewNavigationType' (aka 'enum UIWebViewNavigationType')

No visible @interface for 'WKWebView' declares the selector 'stringByEvaluatingJavaScriptFromString:'

有没有指南告诉你如何一步一步地做到这一点?

标签: xcodeuiwebviewwkwebview

解决方案


推荐阅读