- (BOOL)textFieldShouldReturn:(U ITextField *)textField {
[textField resignFirstResponder];
return YES;
}
Since you are implementing the UITextFieldDelegate class, this method will be called on Return, your text field will give up focus, and the UIKeyboard will disappear. If you want to be more particular and a little safer in your method you can do the following:
- (BOOL)textFieldShouldReturn:(U ITextField *)textField {
if(textField == [self yourTextField]) {
[textField resignFirstResponder];
}
return YES;
}
No comments:
Post a Comment