I'm on this block of code
_bridge = [WKWebViewJavascriptBridge bridgeForWebView:webView webViewDelegate:self handler:^(id data, WVJBResponseCallback responseCallback) {
NSLog(@"ObjC received message from JS: %@", data);
responseCallback(@"Response for message from ObjC");
}];
and converted it to swift code
bridge = WKWebViewJavascriptBridge(forWebView: webView, webViewDelegate: self, handler: {(data: AnyObject, responseCallback: WVJBResponseCallback!) -> Void in
responseCallback("Response for message from ObjC")
})
but I am receiving this error
" Cannot convert value of type '(AnyObject, WVJBResponseCallback!) -> Void' to expected argument type 'WVJBHandler!' "
I'm on this block of code
_bridge = [WKWebViewJavascriptBridge bridgeForWebView:webView webViewDelegate:self handler:^(id data, WVJBResponseCallback responseCallback) {
NSLog(@"ObjC received message from JS: %@", data);
responseCallback(@"Response for message from ObjC");
}];
and converted it to swift code
bridge = WKWebViewJavascriptBridge(forWebView: webView, webViewDelegate: self, handler: {(data: AnyObject, responseCallback: WVJBResponseCallback!) -> Void in
responseCallback("Response for message from ObjC")
})
but I am receiving this error
" Cannot convert value of type '(AnyObject, WVJBResponseCallback!) -> Void' to expected argument type 'WVJBHandler!' "