SwiftRichString icon indicating copy to clipboard operation
SwiftRichString copied to clipboard

using linkURL and color

Open bastianh opened this issue 6 years ago • 3 comments

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.

bastianh avatar Mar 22 '19 17:03 bastianh

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?

malcommac avatar Mar 28 '19 09:03 malcommac

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 avatar Apr 01 '19 13:04 bastianh

@bastianh you can do something like this

textView.linkTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.orange]

rizwan95 avatar Jun 01 '20 12:06 rizwan95