I am getting a title in HTML format as
Example
I
If Html Text is like
var planeText = "Unseen and not Purchased!"
//setting color to the text
var htmlText = "" + planeText + ""
We can set the text to UILabel like this
if let htmlData = htmlText.data(using: String.Encoding.unicode) {
do {
let attributedText = try NSAttributedString(data: htmlData,
options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType],
documentAttributes: nil)
//Setting htmltext to uilable
uilable.attributedText = attributedText
} catch let e as NSError {
//setting plane text to uilable cause of err
uilable.text = planeText
print("Couldn't translate \(htmlText): \(e.localizedDescription) ")
}
}