I am using mywebview.loadHTMLString(htmlCode, baseURL: nil)
but it's not working properly, means it doesn't support javascript and css, it only displayed the text inside that html code.
I am getting the html code from api and store it into the String data type and need to pass to the webview.
I have found one more thing webview.load()
but it shows me "cannot convert value of type 'String' to expected argument type 'Data'.
Does anyone know how to solve this problem?
This is my simple demo html code, which i wanted to display.But i am getting the color which i have used in above html.
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
<p>This is a demo html code, <span style="background-color:#FF0000;">which i wanted to display on UIwebview</span> .</p>
<p>But <span style="color:#800080;">it's wokring</span> properly if i save this code as a<span style="color:#0000FF;"> .html</span> extension then works perfect.</p>
</body>
</html>