title: How to hide keyboard in swift on pressing return key?
body: <p>I am using <code>UITextfied</code> while clicking on textfied keyboard appear but when i pressed the <kbd>return</kbd> key, keyboard is not disappearing. I used the following code:</p>
  
  <pre><code>func textFieldShouldReturn(textField: UITextField!) -&gt; Bool // called when 'return' key pressed. return NO to ignore.
  {
      return true;
  }
  </code></pre>
  
  <p>the method resignfirstresponder is not getting in function.</p>