SwiftRichString
SwiftRichString copied to clipboard
using linkURL and color
Hi,
I think there is a bug? when using linkURL like in the example:
let link = Style {
$0.color = UIColor.red
$0.linkURL = URLRepresentable.tagAttribute("href")
}
the link will still shown in some dark blue because you have to set linkTextAttributes to change that.
Would be nice if you could change it with a Style, too.
HI,
It's outside the scope of the library because it involves changes in UITextView and we have not any access in a specific instance from inside Style. Or am I missing something?
Yes.. I don't think it's easy doable. It's to bad because it's really nice setting a style using interface builder.. but looks like you have to still write code to change the color of links.
@bastianh you can do something like this
textView.linkTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.orange]