Anton
Anton

Reputation: 129

IPad keyboard "Hide button"

How can I interact with the button "hide keypad" In IPad numeric pad. I need to add validation for this button. Or how I can switch off this button?

Upvotes: 2

Views: 1357

Answers (2)

vimal
vimal

Reputation: 11

This is not the delegate method for the keyboard hide button .But I think You can solve this by adding the following code to you .m file

1.Add the following code to your viewWillAppear function

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardDidHideNotification object:nil]; 2.Add the following code to viewWillDisappear function

  [[NSNotificationCenter defaultCenter] removeObserver:self
                                                name:UIKeyboardWillHideNotification
                                              object:nil];

3.Declare function in .h file

     -(void)keyboardWillHide:(NSNotification*)notify;

4.Define function in .m file

-(void)keyboardWillHide :(NSNotification*)notif {

//Add the code for What you wish to do after the key board hide.

}

Upvotes: 1

George
George

Reputation: 115

Use this to get the moment when the user hits that button

- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
    [textField resignFirstResponder];
    //your code here
    return YES;
}

Upvotes: 0

Related Questions