title: Can't dismiss keyboard, UITextField delegate being called OK
body: <p>This problem has been driving me crazy.  It seems no matter what I try I cannot get the keyboard to hide once it is shown in my simple Swift program.  </p>
  
  <p>It does not work when I resignFirstResponder() in textFieldShouldReturn nor does it work when handing a background touch by calling endEditing() from touchesBegan(...).  I can see these respective methods are all being called when I set debugger break points to them, so the delegate is properly set and being called as expected.  </p>
  
  <p>Here are the specific steps I took:</p>
  
  <ul>
  <li>Create a new single-view application Swift project</li>
  <li>Drag a UITextField onto the view, wire up the IBOutlet, and set the ViewController up as UITextFieldDelegate.</li>
  <li>Run in iPhone 6 Simulator or on an iPhone 6 device</li>
  <li>Once the keyboard is presented, it is never dismissed!!</li>
  </ul>
  
  <p>I am out of ideas - what am I missing???</p>
  
  <p>Here is the entire contents of my ViewController:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITextFieldDelegate {
  
  @IBOutlet weak var myTextField: UITextField!
  
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
  
        myTextField.delegate = self
    }
  
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
  
    override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
        self.view.endEditing(true)
    }
  
    func textFieldDidBeginEditing(textField: UITextField!) {
        return
    }
  
    func textFieldShouldEndEditing(textField: UITextField!) -&gt; Bool {
        return false
    }
  
    func textFieldShouldReturn(textField: UITextField!) -&gt; Bool {
        textField.resignFirstResponder()
        return true
    }
  }
  </code></pre>