Hide the cursor of a UITextField Hide the cursor of a UITextField ios ios

Hide the cursor of a UITextField


Simply subclass UITextField and override caretRectForPosition

- (CGRect)caretRectForPosition:(UITextPosition *)position{    return CGRectZero;}


As of iOS 7 you can now just set the tintColor = [UIColor clearColor] on the textField and the caret will disappear.


You can just clear the textfield's tintColor

self.textField.tintColor = [UIColor clearColor];

Swift 3.0

self.textField.tintColor = .clear

enter image description here