UITextField disable cursor

405 views Asked by At

Is there way to disable blinking cursor in UITextField? Probably messing with UITextInput protocol? Thanks for any help!

2

There are 2 answers

0
pommefrite On

A much cleaner way to do it would be to set the tint color to clear as follows:

textField.tintColor = .clear

0
Rodrigo On

This is old and you found a new solution. But there are an idea you can use. I thing the cursor is a image animation, so you can found their view.

Run thought all views with

for (id subview in myTextField.subviews) {
    if (is cursor view){
        subview.hidden = TRUE;
    }
}

Maybe this can work, but it is trial and error.