iOS Hide blinking caret


Example

To hide the blinking caret, you need to override caretRectForPosition of a UITextField and return CGRectZero.

Swift 2.3 <

public override func caretRectForPosition(position: UITextPosition) -> CGRect {
    return CGRectZero 
}

Swift 3

override func caretRect(for position: UITextPosition) -> CGRect {
    return CGRect.zero
}

Objective-C

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