Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Change UITextView Cursor Blink Color in Xcode

Tags:

ios

swift

Hello people can anyone help us in how to change the cursor blink color of UITextView in Xcode using Swift language or from storyboard.

like image 801
Malik Türk Avatar asked Aug 24 '17 07:08

Malik Türk


3 Answers

Swift 4, Xcode 9.1 Beta

I tried setting the tintColor of my UITextView in the interface builder but that didn't work for me. I don't know why, but setting the tintColor on my UITextView to one color, then resetting it to the color I really wanted worked for me...

myUITextView.tintColor = .anySystemColor
myUITextView.tintColor = .theColorYouReallyWant
like image 108
Bikeboy Avatar answered Oct 10 '22 12:10

Bikeboy


For some reason that I don't know, I had to run a didChange method because tintColor on its own doesn't work.

BTW, I'm on Swift 5.

textView.tintColor = .white
textView.tintColorDidChange()

It works for me!

like image 36
unferna Avatar answered Oct 10 '22 13:10

unferna


just change Tint Color

UITextView.appearance().tintColor = .black 

Objective-C:

[[UITextView appearance] setTintColor:[UIColor blackColor]];
like image 23
Abdelahad Darwish Avatar answered Oct 10 '22 13:10

Abdelahad Darwish