我已经为我的应用添加了一个网页视图,但是当我在模拟器甚至设备上运行时,我仍然会看到一个空白的白色屏幕。当我进入apple.com作为网站,它的工作完美,但对于任何其他网站,它只是显示一个空白的白色屏幕。 导入UIKit
class ViewController: UIViewController {
@IBOutlet var WebView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
var URL = NSURL(string: "http://www.apple.com")
WebView.loadRequest(NSURLRequest(URL: URL!))
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}