0
I have a string that is actually a snippet in HTML. I use the following method to convert this snippet into a string and set it in label
let s = Descricao.data(using: String.Encoding.unicode)!
let attrStr = try? NSAttributedString(
data: s,
options: [NSAttributedString.DocumentReadingOptionKey.documentType: NSAttributedString.DocumentType.html],
documentAttributes: nil)
lbl_Titulo.title = Nome_Convenio
lbl_Convenio.numberOfLines = 0
lbl_Convenio.sizeToFit()
lbl_Convenio.textAlignment = .left
lbl_Convenio.attributedText = attrStr
It turns out that this html can have links, which are not opening the browser when clicked. How to make these links clickable?
I use a Uilabel allowing links: https://github.com/TTAttributedLabel/TTAttributedLabel
– Ronaldo Albertini