I have the following code
@IBOutlet weak var webView: WKWebView!
if var body = self.data.body {
body += "<meta name=\"viewport\" content=\"initial-scale=1.0\" />"
webView.loadHTMLString(body, baseURL: nil)
let css = "body { font-size: 18px; line-height: 28px; } h1 { font-size: 40px; text-align: left; margin-bottom: 12px; line-height: 1.3; } h2 { font-size: 26px; font-weight: 700; padding: 0; margin-bottom: 10px; text-align: left; line-height: 34.5px; letter-spacing: -0.45px; } p, i, a { margin-top: 21px; font-size: 20px; letter-spacing: -0.03px; line-height: 1.57; }";
let js = "var style = document.createElement('style'); style.innerHTML = '\(css)'; document.head.appendChild(style);"
webView.evaluateJavaScript(js, completionHandler: nil)
}
Unfortunately, the webview doesn't show the right font size. Also, how do I change the font family of the body? I'm I doing something wrong?