Set a delegate object for the UITextField object (point to your view controller) and use the method
- (BOOL)textFieldShouldReturn:(UITextField *)textField
-textFieldShouldReturn will be called immediately before the user who the user types βGoβ or βReturnβ. Remember to return YES.
source share