How can i detect backspace button pressed on UIKeyboard
?
thanks
EDIT: Is there any keyboard delegate that returns key pressed value?
if the UITextField is empty, the shouldChangeTextInRange delegate method is not called You can subclass UITextField and override this method:
-(void)deleteBackward;
{
[super deleteBackward];
NSLog(@"BackSpace Detected");
}
since UITextField is compliant to the UITextInput protocol, this method is implemented, and you can override it to detect when backspace is pressed. Then, you can write your own protocol/delegate method to alert your custom textfield delegate if the backspace is detected.