I'm using UIWebView in my application for some reasons that WKWebView can't fit for me.
Explaining that, I just finished with my application conversion to Swift3 (Was 2.2) and my shouldStartLoadWith
functions not getting the JS event.
If i run my previous build before the conversion - everything working perfect.
My code look like this:
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
let url:URL = request.url!
if (url.scheme == "something"){
if (url.host != nil){
var properString = url.absoluteString.removingPercentEncoding!
properString = properString.replacingOccurrences(of: "something://", with: "")
performJSFunction(message: properString)
}
return false;
}
return true
}
note: nothing changes in the server side/html page.