我在swift中从url加载一个html页面UIWebView,我想知道如何在点击加载新页面后获取html中链接的URL.经过一番搜索,我找到了类似的东西shouldStartLoadWithRequest,LinkClicked但它并没有真正帮助.
我知道答案很晚,但我想这可能就是你要找的东西.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)
| 归档时间: |
|
| 查看次数: |
2880 次 |
| 最近记录: |