I have UITextview which is assigned to attributed text, It is rendering correctly but its not applying the link colour, in below snippet the link colour is #EB0A1E but in textview it is visible as blue(default link color)
textView.attributedText = "Google.com link <a href = \"https://google.com\" style=color:#EB0A1E;>here</a><br><br> Hello there".htmlToAttributedString
extension String {
var htmlToAttributedString: NSAttributedString? {
guard let data = data(using: .utf8) else { return NSAttributedString() }
do {
return try NSAttributedString(data: data, options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding: String.Encoding.utf8.rawValue], documentAttributes: nil)
} catch {
return NSAttributedString()
}
}
}