I have an HTML fragment which is taken from an outer database. It is not a local asset file.
On the other hand, I have 5-6 files of my own CSS and JS files which this HTML use.
I added those CSS and JS files by adding their parent directory:
File -> Add files to "MyProject"
The parent directory is called: web_assets
Then, I want to use these files in my WKWebView.
I tried this:
var myBundle = Bundle.main.bundleURL
myBundle.appendPathComponent("web_assets", isDirectory: true)
contentWKWebView.loadHTMLString(html, baseURL: myBundle)
This is not working.
Any idea?