This code is supposed to load the Apple homepage, but instead shows a blank screen.
This happens with both HTTP and HTTPS URLs.
Code:
import UIK
The following code works just fine for me in Xcode 9.3:
import UIKit
import WebKit
class ViewController: UIViewController {
var webView: WKWebView!
override func loadView() {
webView = WKWebView(frame: .zero, configuration: WKWebViewConfiguration())
self.view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
webView.load(URLRequest(url: URL(string: "https://www.apple.com")!))
}
}
Here's the result: