Skip to content

Instantly share code, notes, and snippets.

@GE-N
Created July 12, 2015 01:38
Show Gist options
  • Save GE-N/59cf9bd622b047dade5e to your computer and use it in GitHub Desktop.
Save GE-N/59cf9bd622b047dade5e to your computer and use it in GitHub Desktop.
Hidden UITextfield's blink cursor.
// Disable blink caret inspired from Joseph Chiu's answer on
// http://stackoverflow.com/questions/3699727/hide-the-cursor-of-an-uitextfield
extension UITextField {
public override func caretRectForPosition(position: UITextPosition!) -> CGRect {
if <# condition for hidden blink #> {
return CGRectZero
}
return super.caretRectForPosition(position)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment