5

iOS Version on which the bug is reproducable: 10.3.2

Code runs correctly on iOS 10.3.1 and earlier

Whenever I try to load a youtube video url on UIWebView, I got the following error:

The operation could not be completed. (NSURLErrorDomain error -999.)

The UIWebView request loading is simple and done like below:

// ...
let urlRequest = URLRequest(url: url)
self.webView.loadRequest(urlRequest)
// URL is: https://www.youtube.com/watch?v=hntVmN2aK8k

func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
   print(error.localizedDescription) // The operation could not be completed. (NSURLErrorDomain error -999.)
}
Malloc
  • 15,434
  • 34
  • 105
  • 192

0 Answers0