title: Hiding the Keyboard on button click?
body: <p>I am creating iPhone app which I show below.</p>
  
  <p>At the end of screen I have text field. I have added a delegate for the same. As it is number pad, I have added button seperately so that when button is clicked, they keyboard is hidden.</p>
  
  <p>Below is the code I have:</p>
  
  <h2>.h</h2>
  
  <pre><code>@interface SearchViewController : UIViewController&lt;UITextFieldDelegate&gt;
  
  @property (retain, nonatomic) IBOutlet UITextField *textField006;
  @property (retain, nonatomic) IBOutlet UIButton *doneButton;
  - (IBAction)doneAction:(id)sender;
  </code></pre>
  
  <h2>.m</h2>
  
  <pre><code>- (BOOL)textFieldShouldReturn:(UITextField *)textField
  {
      NSLog(@"textFieldShouldReturn");
      return YES;
  }
  
  - (void)textFieldDidBeginEditing:(UITextField *)textField
  {
      NSLog(@"textFieldDidBeginEditing");
      // Ensure the relevant text field is visible
      CGAffineTransform translation = CGAffineTransformIdentity;
      CGRect screenBound = [[UIScreen mainScreen] bounds];
      CGSize screenSize = screenBound.size;
      CGFloat screenHeight = screenSize.height;
  
      if (screenHeight==480 || screenHeight==568) {
              translation = CGAffineTransformMakeTranslation(0, -120);
          doneButton.hidden = NO;
          NSLog(@"line 3");
          [UIView beginAnimations:nil context:nil];
          self.view.transform = translation;
          [UIView commitAnimations];
      }
  }
  
  - (IBAction)doneAction:(id)sender {
      doneButton.hidden = NO;    
      doneButton.hidden = YES;
      [textField006 resignFirstResponder];
      [UIView beginAnimations:nil context:nil];
      self.view.transform = CGAffineTransformIdentity;
      [UIView commitAnimations];
      [self.textField006 resignFirstResponder];
  
  }
  </code></pre>
  
  <p>Why isn't the keyboard hiding? How can I hide it?</p>
  
  <blockquote>
    <p>Keyboard == Decimal Pad Return key >> Go Auto-enable Return key =
    Ticked</p>
  </blockquote>