How to load html text in watchkit WKInterfaceLabel in ios? -
i have on wkinterfacelabel in can not load html tag
<h1>grishneshwar jyotirling</h1>
and can't use nsmutableattributedstring
please me finding regarding things.
var htmltext = "<h1>grishneshwar jyotirling</h1> grishneshwar jyotirling" let attributetext: nsattributedstring? if let htmldata = htmltext.datausingencoding(nsunicodestringencoding) { { attributetext = try nsattributedstring(data: htmldata , options: [nsdocumenttypedocumentattribute: nshtmltextdocumenttype], documentattributes: nil) mylabel.setattributedtext(attributetext) }catch let e nserror { print("couldn't translate \(htmltext): \(e.localizeddescription) ") }
Comments
Post a Comment