title: Why is the textFieldShouldReturn function not being called?
body: <p>The <code>textFieldShouldReturn</code> function is not being called at all: there are no errors but the keyboard does not respond at all.</p>
  
  <p>My case is different from <a href="https://stackoverflow.com/questions/24180954/how-to-hide-keyboard-in-swift-on-pressing-return-key">How to hide keyboard in swift on pressing return key?</a> as in my case nothing is happening at all and other cases are in Objective-C.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
      @IBOutlet var textField: UITextField!
  
      func textFieldShouldReturn(textField: UITextField) -&gt; Bool {
          resignFirstResponder()
          return true
      }
  }
  </code></pre>
  
  <p>textField is an outlet to a text field on my storyboard. I also tried <code>self.endEditing</code> instead of <code>resignFirstResponder</code>.</p>