I am able to load a HTML string into the UIWebView with CSS obtained from an online source. The problem I have now is to get the path of the link that was clicked. If I use this:
webView.loadHTMLString(finalHtml, baseURL: baseUrl)
I get the path clicked to be "/" when I println(webView.request?.URL.path) in the UIWebViewDelegate shouldStartLoadWithRequest.
If I use this:
webView.loadHTMLString(finalHtml, baseURL: nil)
I get "nil" when I println(webView.request?.URL.path)
Of course, I have set the baseURL to be the original website, but from my understanding, if the link has the full address, the baseURL is irrelevant.
Any pros out there with any advice on how to get the actual path that is indicated in the tags of the link that was clicked? Thank you in advance =D
EDIT When I long click the link, there will be a popup with the correct link shown. I have tried everything, including absoluteString, but I still won't get the path.