Breaking News
Home / iOS / iOS FAQ / How to hide the keypad when Return button is clicked in iPhone?

How to hide the keypad when Return button is clicked in iPhone?

Issue

When the finger is tapped into a textfield of an iOS view, the default Keypad show up from the bottom. The user enters the text and clicks on the Return/Done button however the Keypad still stays.

Solution

The iOS does not hide the Keypad on its own and needs the control to resign as the first responder. This can be done using the following snippet.

– (BOOL)textFieldShouldReturn:(UITextField *)textField {

     [textField resignFirstResponder];

return NO;

}

[pb_builder]

Check Also

How to remove an app from Sale in Appstore?

Solution In order to remove you app from SALE, you would have to log into …

Advertisment ad adsense adlogger