iPhone: Close keyboard when done button pressed


/ Published in: Objective C
Save to your folder(s)

make your class implement the
on your UITextField object, do myTextField.delegate = self.


Copy this code and paste it in your HTML
  1. #pragma mark -
  2. #pragma mark UITextFieldDelegate methods
  3. - (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
  4. [theTextField resignFirstResponder];
  5. return YES;
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.