-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swift5 使用WKWebView跟h5没法交互 #398
Comments
跟swift5应该没关系,我用的好好的 |
我已经重构了这个库. |
bridge 强引用试试,var gBridge: WKWebViewJavascriptBridge? ... gBridge = bridge |
try this: protocol WebviewWithBridgePr{
} extension WebviewWithBridgePr{ // let config = WKWebViewConfiguration.init()
} |
用UIWebView可以实现跟h5交互
但是用WKWebView就没没响应
以下是iOS的方法调用
import UIKit
import WebKit
import WKWebViewJavascriptBridge
/// 工单报修
class VKBaseWebViewCtrl: VKBaseViewCtrl {
}
extension VKBaseWebViewCtrl: WKUIDelegate,WKNavigationDelegate,UIWebViewDelegate{
// func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
// hideHud()
// }
//
// func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
// hideHud()
// Log(message: "加载失败")
// }
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
print("webViewDidStartLoad")
}
}
The text was updated successfully, but these errors were encountered: