The essence of this: there is a WebView
, which is passed a string containing HTML.
Looks like that:
let newsHTML = receviedNewsText viewNewsHTML.loadHTMLString(newsHTML, baseURL: nil)
viewNewsHTML
- actually, the WebView
itself;receviedNewsText
is HTML (from tags there is only p and sometimes a), which comes from the server via JSON.
Since there are no styles there, the text is plain, small, and ugly.
The goal is that inside WebView I can use styles for the p tag.
How can I do that? Ideally, this will be a .css file inside the application, the styles from which will be loaded into WebView. But maybe there is some other way.
I would appreciate advice. Thank!