Can I change the color of auto detected links on UITextView?

Leandro Alves picture Leandro Alves · Aug 29, 2009 · Viewed 50k times · Source

I had a UITextView that detects phone numbers and links, but this overrides my fontColor and change it to blueColor. Is there a way to format the color of auto detected links, or should I try a manual version of this function?

Answer

stonemonk picture stonemonk · Sep 27, 2013

On iOS 7 you can set the tintColor of the UITextView. It affects the link color as well as the cursor line and the selected text color.

iOS 7 also added a new property to UITextView called linkTextAttributes which would appear to let you fully control the link style.