You can do it this way, first is to convert the html xml to html and create an empty file then save it as .html and load it to your webView.
Once you have the .html file you can do this on your viewController:
@IBOutlet weak var productWebView: WKWebView!
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let htmlPath = Bundle.main.path(forResource: "sample", ofType: "html")
let url = URL(fileURLWithPath: htmlPath!)
let request = URLRequest(url: url)
productWebView.load(request)
}
1
solved How To Show Html Code Via WebView On iOS App By Swift