Search code examples
swiftuiwebview

Get URL of link clicked in a web view swift


I load a html page from url in a UIWebView in Swift and I would like to know how I can get the URL of a link in my html after click to load a new page. After some search I found something like shouldStartLoadWithRequest and LinkClicked but it's not really helpful.


Solution

  • I used WKWebView and with some script I inject some CSS so no need to get url after click.