How can I detect when a user pressed "return" keyboard button while editing UITextField? I need to do this in order to dismiss keyboard when user pressed the "return" button.
Thanks.
- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return NO; }
Don't forget to set the delegate in storyboard...
2.1m questions
2.1m answers
60 comments
57.0k users