我正在使用webview
制作一个简单的Swift 3
。但是在跑完之后我只得到了空白屏幕。
它没有打开我在url请求中输入的链接。
import UIKit
class ViewController: UIViewController {
@IBOutlet var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = URL (string: "http://www.google.net");
let request = URLRequest(url: url!);
webView.loadRequest(request);
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}