获取在Web视图中快速点击的链接的URL

mat*_*972 -1 uiwebview swift

我在swift中从url加载一个html页面UIWebView,我想知道如何在点击加载新页面后获取html中链接的URL.经过一番搜索,我找到了类似的东西shouldStartLoadWithRequest,LinkClicked但它并没有真正帮助.

DG7*_*DG7 5

我知道答案很晚,但我想这可能就是你要找的东西.request.URL!为您提供所点击内容的URL.

func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {

    let scheme = request.URL!
        NSLog(scheme)


}
Run Code Online (Sandbox Code Playgroud)