How to load a local HTML page into WKWebview ?
I set allowingReadAccessTo to the directory containing all files. But still get an error.
if let testTempUrl = Bundle.main.url(forResource: "index", withExtension: "html", subdirectory:"sub") {
if FileManager.default.fileExists(atPath: testTempUrl.path) {
webViewWK.loadFileURL(testTempUrl, allowingReadAccessTo: testTempUrl.deletingLastPathComponent())
} else {
askSiriWhy()
}
}
The HTML page loads without problem if I use UIWebView instead of WKWebView.