Q:

iPhone iOS how to change color of some words within UITextView?

I'd like to offer a user of my app the ability to highlight or change color of selected words within a UITextView. I know how to change the entire text color:
 textView.textColor = [UIColor redColor];

This is not what I'm looking for. I need to know how to change color of arbitrary sequences of characters within a UITextView. I have not seen such feature in the text views up to date, so I think it's not supported out of the box. Are there any open source projects or examples on how to change color or highlight blocks of text within a UITextView? 
Thank you!

A:

You can create CATextLayer and assign NSAttributed string to it. Have a look at here. You can make use of DTCoreText

