In iOS, WKWebView doesnt support loading a local HTML file with remote resources directly using both loadFileURL(:allowingReadAccessTo:) & loadHTMLString(:baseURL:) in the same request.
However, you can achieve your goal by reading the local HTML file as a string, then using loadHTMLString(_:baseURL:) with the appropriate base URL to access both local and remote resources.
Here’s how:
Load the HTML Content as a String: Read the local HTML file content and load it as a string.
Set the baseURL: Use the directory URL containing your local resources as the baseURL in loadHTMLString(_:baseURL:). This will allow access to both local and remote resources referenced with relative paths.