Link in an NSAttributedString

0

I have a string that is actually a snippet of HTML. I use the following method to convert this snippet to a string and set it to

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 may have links, which are not opening the browser when clicked. How do you make these links clickable?

    
asked by anonymous 28.12.2018 / 14:23

0 answers