I want to get current url of wkwebview. please give the solution. Thanx in advanced...
get current url of wkwebview (Swift iOS)
Add a Comment
I want to get current url of wkwebview. please give the solution. Thanx in advanced...
You can use: webView.url
I think this may work -
extension CCVAddCardViewController: WKUIDelegate, WKNavigationDelegate {
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
if let urlStr = navigationAction.request.url?.absoluteString {
print(urlStr)
}
decisionHandler(.allow)
}
}