Open sger opened 4 years ago
Same here.
I also experience this issue. I am using UITextView.
It's not linked to SwiftyMarkdown
but to the behavior of UITextView
, simply set your UITextView().tintColor = UIColor.whatEverColorYouWant. It'll be OK.
@sger did you manage to find a solution? I am having the same issue, and modifying the tintColor property of my UILabel doesn't work.
For those who have the issue, I did find a quick fix that involves you to fork the library (a pull request might be better idk).
NSAttributedString.Key.link color will be blue by default. So if you need a custom color you can set the .attachment
attribute instead of .link
and set the .foregroundColor
and .underlineColor
with the colors you want. To do so:
attributedStringFor( tokens : [Token], in line : SwiftyLine ) -> NSAttributedString
(~ around line 444)for token in finalTokens
loop.attributes[.link]
for attributes[.attachment]
You're good!
NB: If you detect taps on your UILabel in order to open the tapped link inside the UILabel, be sure to also modify .link
for .attachment
if you use the method enumerateAttribute(_ attrName: NSAttributedString.Key, in enumerationRange: NSRange, options opts: NSAttributedString.EnumerationOptions = [], using block: (Any?, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)
For this string:
Lorem ipsum. [apple](https://apple.com/)
changing the color of the link doesn't work