ios swift webView
2017-10-27 本文已影响0人
翔战士
1.@IBOutlet weak var webView: UIWebView!
2.let url = URL(fileURLWithPath: "http://www.baidu.com")
3.let urlRequest = URLRequest(url: url)
4.webView.loadRequest(urlRequest)
5.info.plist配置相关的权限
App Transport Security Settings
Allow Arbitrary Loads ------- YES