ios - WKWebView does not load NSURLs created with fileURLWithPath:relativeToURL: -
i noticed wkwebview
not load (via loadfileurl:allowingreadaccesstourl:
) nsurl created fileurlwithpath:relativetourl:
.
i created github repo showing behavior: https://github.com/davidkraus/wkwebviewnsurl
as workaround can pass absolute string of url new nsurl.
var theurl = nsurl(fileurlwithpath: "www/index.html", relativetourl: folder) // create new nsurl theurl = nsurl(string: theurl.absolutestring)! webview.loadfileurl(theurl, allowingreadaccesstourl: theurl)
Comments
Post a Comment