Using Swift with WebView:
I am creating html which I display in the webView control. The text html displays as expected but I am having trouble displaying and image which is in the project.(bundle) below is the code I have tried:
let urlpath = Bundle.main.path(forResource: "ld", ofType: "png");
webOut += "<img src='\(urlpath!)' height='16' width='16'>"
webOut += "<h3 style='color:#FD7D70ff'>\(sta.person!)</h3>"
webOut += "<div style='font-size: \(statementTextSize)'>\(sta.text!)</div>"
let requesturl = NSURL(string: urlpath!)
webView.loadHTMLString(webOut, baseURL: requesturl as URL?)
the image does not display.
What is the best way to display an image in this scenario?