title: swift 2.0 - UITextFieldDelegate protocol extension not working
body: <p>I'm trying to add a default behavior on some <code>UITextFieldDelegate</code>'s methods using protocol extensions like so :</p>
  
  <pre><code>extension ViewController: UITextFieldDelegate {
      // Works if I uncommented this so I know delegates are properly set
  //    func textFieldShouldReturn(textField: UITextField) -&gt; Bool {
  //        textField.resignFirstResponder()
  //        return true
  //    }
  }
  
  extension UITextFieldDelegate {
      func textFieldShouldReturn(textField: UITextField) -&gt; Bool {
          textField.resignFirstResponder()
  
          return true
      }
  }
  </code></pre>
  
  <p>As you may guess, the keyboard never dismiss. I can't really see where's the problem here. Is this a language limitation ? Did someone already success doing it ?</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>As @Logan suggested, default protocol's method implementation doesn't work with protocols marked as <code>@objc</code>. However, <code>UITextFieldDelegate</code> has the following signature <code>public protocol UITextFieldDelegate : NSObjectProtocol {...}</code></p>
  
  <p>I've test default implementation for <code>NSObjectProtocol</code> and it seems to works fine :</p>
  
  <pre><code>protocol Toto: NSObjectProtocol {
      func randomInt() -&gt; Int
  }
  
  extension Toto {
      func randomInt() -&gt; Int {
          return 0
      }
  }
  
  class Tata: NSObject, Toto {}
  
  let int = Tata().randomInt() // returns 0
  </code></pre>