title: How do you use a default protocol implementation with performSelector in swift?
body: <p>I created a protocol with a single method and a default implementation by creating an extension to that protocol.  My app crashes because perform selector doesn't recognize the default implementation. </p>
  
  <p>The method can actually be called directly with no problems.  Using respondsToSelector for the method returns false, and performSelector for the method crashes.  </p>
  
  <p>Implementing the protocol in the actual class, or in an extension of the class makes it work, but that defeats the purpose of the default implementation.</p>
  
  <p>I also filed a bug report to apple.</p>
  
  <pre><code>public protocol TestProtocol
  {
    func testMethod()
  }
  
  extension TestProtocol
  {
    public func testMethod() {
      print("testing the method...")
    }
  }
  
  class ViewController: UIViewController, TestProtocol {
  
    @IBOutlet weak var button: UIButton!
  
    override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  
      self.button.addTarget(self, action: "testMethod", forControlEvents: UIControlEvents.TouchUpInside)
  
      print(self.respondsToSelector("testMethod"))
      self.testMethod()
  //    self.performSelector("testMethod")
    }
  
    override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
    }
  }
  </code></pre>