在UIWebView代理方法
func webView(webView: UIWebView,shouldStartLoadWithRequest request: NSURLRequest,navigationType: UIWebViewNavigationType) -> Bool
中可以获取
var url:String = request.URL!.absoluteString
nowWebUrl = url
nowWebTitle = ziXunWebView.stringByEvaluatingJavaScriptFromString("document.title")
原文链接:https://www.f2er.com/swift/322821.html