Swift 4 WebKit webView does not load URL with added parameter
Your id is working fine:
override func viewDidLoad() {
super.viewDidLoad()
let webView = WKWebView(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height))
self.view.addSubview(webView)
let url = URL(string: "https://www.youtube.com/watch?v=695PN9xaEhs")
webView.load(URLRequest(url: url!))
}
In my case, I was trying to load an HTTP site instead of HTTPS. Initially it didn't load anything but when I used HTTPS, the site loaded as expected.