title: tap gesture recognizer does not get fire
body: <p>I want to implement an action, when if the user tap somewhere on the screen, then the keyboard should disappear.    </p>
  
  <p>I have an app, that look as follow<br>
  <a href="https://i.stack.imgur.com/2yRGp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2yRGp.png" alt="enter image description here"></a>   </p>
  
  <p>When I tap on textfield then the keyboard appears, that is good.<br>
  Now I want, when I tap somewhere on the screen, then the keyboard should disappear.<br>
  I implemented a tap gesture recognizer with following property value:
  <a href="https://i.stack.imgur.com/Xci37.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xci37.png" alt="enter image description here"></a> 
  <a href="https://i.stack.imgur.com/TyjUU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TyjUU.png" alt="enter image description here"></a>  </p>
  
  <p>And the tap gesture recognizer I bound with following action in the view controller </p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
      @IBOutlet weak var nameField: UITextField!
      @IBOutlet weak var numberField: UITextField!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      @IBAction func textFieldDoneEdition(sender: UITextField) {
          sender.resignFirstResponder()
      }
  
      @IBAction func onTapGestureRecognized(sender: AnyObject) {
  
          nameField.resignFirstResponder()
          numberField.resignFirstResponder()
      }
  
  } 
  </code></pre>
  
  <p>Tap gesture recognizer is bound to the function.
  <a href="https://i.stack.imgur.com/bZFOn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bZFOn.png" alt="enter image description here"></a>
  And it does not work at all, when I tap somewhere on the screen. The keyboard is still there. What am I doing wrong? </p>