This above is my HTML which should be displayed on my webView.
Everything displays fine except images.
I highlighted an example of img tag.
Does anyone know a reason why? I have made a folder in my app with this path and also on desktop in every case, but it doesn't work.
Code:
var html = """
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
"""
func to load html&css:
func loadHtmlCss() {
guard let path = Bundle.main.path(forResource: "style", ofType: "css") else { return }
let cssString = try! String(contentsOfFile: path).trimmingCharacters(in: .whitespacesAndNewlines)
html += cssString
html += "</style></head>"
html += cards[Int(slider.value) - 1].title
html += "<br><hr>"
html += cards[Int(slider.value) - 1].content // this is shown on the picture above.
html += "</body>"
webView.loadHTMLString(html, baseURL: nil)
}