Make the keyboard display the blue Search button by setting the type of return key.
myTextField.returnKeyType = UIReturnKeySearch;
Set the delegate of your text field to your controller and implement the textFieldShouldReturn: method.
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
source
share