Hi, I am trying to load an html that is in the main Bundle with WKWebView, which worked fine with UIWebView, but now I have an error, the files in html do not load sending the error in the console: "XMLHttpRequest cannot load"


this is an example of http://proyectoshm.com/esferas/dosaguas/dosaguascitta.html nested content.
My code is:
let folder = "maquetas/esferas/\(esfera)" let resourcePath = Bundle.main.resourcePath let subdir = URL(fileURLWithPath:resourcePath!).appendingPathComponent(folder, isDirectory: true) guard let path = Bundle.main.path(forResource: "index", ofType: "html", inDirectory: folder) else { print("no se encontrΓ³ path") return } print(subdir.path) let url = NSURL.fileURL(withPath: path) print(url.path) vistaweb = WKWebView(frame: self.view.frame) vistaweb.loadFileURL(url, allowingReadAccessTo: subdir) self.view.addSubview(vistaweb)
source share