Ian*_*Ian 10
在NSURL类中存在的.query属性返回后的所有内容的字符串?在url中的形式:http://www.example.com/index.php? key1 = value1&key2
= value2
在此示例中使用代码:
var url: NSURL = NSURL(string: "http://www.example.com/index.php?key1=value1&key2=value2")
println(url.query) // Prints: Optional("key1=value1&key2=value2")
Run Code Online (Sandbox Code Playgroud)
文档中的更多信息
从uiwebview获取网址,你可以使用以下内容:
let url: NSURL = someWebView.NSURLRequest.URL
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8937 次 |
| 最近记录: |