I'm trying to load content into a UIWebView, and when testing in the simulator, all I get is a white screen and the following error in the console:
NSURLConnection finished with error - code -1100
Can anyone help? My current Swift code is:
class ViewController: UIViewController {
@IBOutlet weak var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
webView.allowsInlineMediaPlayback = true;
webView.mediaPlaybackRequiresUserAction = false;
webView.loadRequest(URLRequest(url: URL(fileURLWithPath: Bundle.main.path(forResource: "www/index", ofType: "html")!)))
let statusBar = UIApplication.shared.value(forKeyPath: "statusBarWindow.statusBar") as? UIView
statusBar?.backgroundColor = UIColor.clear
}
}
Just to clarify, this code works for me, but I cannot find anything on the Internet regarding error -1100. Many thanks.
source
share