title: Tap Gesture Recognizer Interfering with Clear Button
body: <p>I have a UITextField with the clear button enabled. I also have some code that dismisses the keyboard when the user taps anywhere else on the screen:</p>
  
  <pre><code>let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
  tap.cancelsTouchesInView = false
  view.addGestureRecognizer(tap)
  
  func dismissKeyboard() {
      view.endEditing(true)
  }
  </code></pre>
  
  <p>The problem is that this code interferes with the clear button, so the text field is never cleared. How do I prevent the tap gesture recognizer from handling the clear button tap?</p>