You must use the delegate method of UITextField . (Install the delegate from TextField to fix viewController in Interface Builder or in source)
Next, go to the textField view manager file .h file:
@interface correctViewController(type yours) :UIViewController <UITextFieldDelegate> //now correctViewController "understands" our textfield.
Go to the correctViewController.m file:
//Create delegate method of textField -(BOOL)textFieldShouldReturn:(UITextField *)textField{ [textField resignFirstResponder]; //to hide keyboard return NO; }
It looks like this.
source share