title: Overriding method with selector 'touchesBegan:withEvent:' has incompatible type '(NSSet, UIEvent) -> ()'
body: <p>Xcode 6.3.  Within a class implementing UITextFieldDelegate protocol, I would like to override touchesBegan() method to possibly hide the keyboard.  If I avoid a compiler error in the function spec, then there is a complier error trying to read the "touch" from the Set or NSSet, or else the   super.touchesBegan(touches , withEvent:event) throws an error.  One of these combinations compiled in Xcode 6.2!  (So where is documentation to Swift "Set" and how to get an element from one?)</p>
  
  <pre><code> override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { 
      // Hiding the Keyboard when the User Taps the Background
          if let touch =  touches.anyObject() as? UITouch {
              if nameTF.isFirstResponder() &amp;&amp; touch.view != nameTF {
                  nameTF.resignFirstResponder();
              }
          }
          super.touchesBegan(touches , withEvent:event)
      }
  </code></pre>
  
  <p>Try:</p>
  
  <pre><code>override func touchesBegan(touches: NSSet, withEvent event: UIEvent) or
  override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent) 
  </code></pre>
  
  <p>Compiler error:
  Overriding method with selector 'touchesBegan:withEvent:' has incompatible type '(NSSet, UIEvent) -> ()'
  and</p>
  
  <pre><code>super.touchesBegan(touches , withEvent:event)
  </code></pre>
  
  <p>also complains</p>
  
  <p>'NSSet' is not implicitly convertible to 'Set'; did you mean to use 'as' to explicitly convert?</p>
  
  <p>Try:</p>
  
  <pre><code>override func touchesBegan(touches: Set&lt;AnyObject&gt;, withEvent event: UIEvent) 
  </code></pre>
  
  <p>Compiler error:
   Type 'AnyObject' does not conform to protocol 'Hashable'</p>
  
  <p>Try:</p>
  
  <pre><code>override func touchesBegan(touches: Set&lt;NSObject&gt;, withEvent event: UIEvent) 
  </code></pre>
  
  <p>Compiler error at </p>
  
  <pre><code>if let touch = touches.anyObject() as? UITouch 
  </code></pre>
  
  <p>'Set' does not have a member named 'anyObject' BUT the function spec and call to super() are OK!</p>
  
  <p>Try:</p>
  
  <pre><code>override func touchesBegan(touches: NSSet&lt;AnyObject&gt;, withEvent event: UIEvent) -&gt; () or
  override func touchesBegan(touches: NSSet&lt;NSObject&gt;, withEvent event: UIEvent) 
  </code></pre>
  
  <p>Compiler error:
  Cannot specialize non-generic type 'NSSet'</p>