Skip to content

A UITextField subclass that will tell you when the user hits the backspace key at the start of the field.

Notifications You must be signed in to change notification settings

0xced/HSBackspaceFriendlyTextField

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HSBackspaceFriendlyTextField

This code is dangerous, and likely to break on minor system updates. Use at your own risk.

This project shows how to detect when the user hits the backspace key at the beginning of a UITextField. There is no publicly exposed mechanism for doing this, so HSBackspaceFriendlyTextField uses some runtime wizardry to subclass an internal UIKit class in order to detect the backspace keypress.

This mechanism is obviously not Apple-approved. I have tested it on iOS 5.0. I make no guarantee about compatibility with future iOS releases, compatibility with the App Store Review Guidelines, or anything else. I've tried to make it fail gracefully, but I cannot anticipate everything Apple might do in the future.

The license on this code is quite simple:

  • Use it however you like.
  • No attribution required.
  • No contributor to this code shall be held liable for any defects, faults, etc. relating to the use of this code. Use at your own risk.

About

A UITextField subclass that will tell you when the user hits the backspace key at the start of the field.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 100.0%