title: ios - make keyboard disappear when UIButton is pressed
body: <p>I am trying to make the keyboard disappear when a UIButton is pressed -</p>
  
  <pre><code>-(IBAction)nextButtonPressed{
      [usernameTextField resignFirstResponder];
      [passwordTextField resignFirstResponder];
  }
  </code></pre>
  
  <p>I have declared the button as IBOutlet and connected it to the IBAction in the storyboard. But the code however does not work and keyboard remains visible. What am I doing wrong ?</p>