I want to load html file to WebView from local custom folder - ProjectNameFolder/test/index.html
.
Trying this code, but doesn't work.
mWebView.loadRequest(URLRequest(url: URL(fileURLWithPath: Bundle.main.path(forResource: "test/index", ofType: "html")!) as URL))
EDITED
When I do without folder name, works perfectly.
mWebView.loadRequest(URLRequest(url: URL(fileURLWithPath: Bundle.main.path(forResource: "index", ofType: "html")!) as URL))
P.S. I'm new in Swift.
I found solution for my problem.
Drag and drop test folder into project folder.
Here is code
override func viewDidLoad() {
super.viewDidLoad()
mWebView.loadRequest(URLRequest(url: URL(fileURLWithPath: Bundle.main.path(forResource: "test/index", ofType: "html")!)))
}