RileyE RileyE - 1 year ago 770
iOS Question

Change UITextField and UITextView Cursor / Caret Color

I'm wondering about changing the color of the cursor / caret in a

if its the same answer) in iOS. I've seen answers for OSX development, but nothing for iOS.

Is this even possible?

Answer Source

If you're targeting iOS 7+, this has been made much easier. Simply change the tintColor of the field with a cursor using the appearance proxy and it will apply throughout the app:

[[UITextField appearance] setTintColor:[UIColor blackColor]];

Same answer applies for a UITextView:

[[UITextView appearance] setTintColor:[UIColor blackColor]];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download