If I understand from the comments and your code ( Path.localPath should be linked to your local resources ..), you should do with local files. I remember this should be due to your incorrect method for loading a local resource into WkWebView . In fact, since iOS 9.0 + , as docs explains, you can use the instance method loadFileURL(_:allowingReadAccessTo:)
You should also try using loadHTMLString :
let path2Esferas = Path.localPath.stringByAppendingPathComponent(path: "\(Path.DIR_IMAGES)\(ImagenDescargaTipo.esfera.rawValue)/\(desarrollo.id)/virtualtour.html") let folderPath = Path.localPath.stringByAppendingPathComponent(path: "\(Path.DIR_IMAGES)\(ImagenDescargaTipo.esfera.rawValue)/\(desarrollo.id)") let baseUrl = URL(fileURLWithPath: folderPath, isDirectory: true) do { let htmlString = try NSString(contentsOfFile: htmlPath!, encoding: String.Encoding.utf8.rawValue) webView.loadHTMLString(htmlString as String, baseURL: baseUrl) } catch {
PS Make sure your local html / JavaScript / CSS files are added in Project -> Target -> Build Phases -> Copy Bundle Resources
In any case, remember that you can only load your local resources after the download is complete, so if you have asynchronous loading, make sure you finish it to use this code.
source share