title: Swift discover protocol methods
body: <p>I'm developing a HTML5 showcase application and I need to discover all the methods in my Swift protocols. All the protocols extends from a base protocol.</p>
  
  <p>The application is a HTML5 showcase for testing this methods. The app calls the method and gives the response.</p>
  
  <p>I found some information about one specific protocol but i need to discover all the protocols in my app and then all the information (name, arguments name arguments type and return values) about this methods.</p>
  
  <pre><code>@objc protocol Protocol {    
      func method1()
      func method2() -&gt; Bool
      func method3(param1:Int) -&gt; Bool
      func method4(param1:Int, param2:Int, param3:Int) -&gt; Bool
  }
  
  var numMethods:UInt32 = 0
  var methods:UnsafeMutablePointer&lt;objc_method_description&gt; = protocol_copyMethodDescriptionList(Protocol.self, true, true, &amp;numMethods)
  
  for var iuint:CUnsignedInt = 0; iuint &lt; numMethods; iuint++ {
  
      var i:Int = Int(iuint)
      var method:objc_method_description = methods[i]    
      println("Method #\(i): \(method.name)")
  }
  </code></pre>
  
  <p>I'm using Objective-C Runtime Reference</p>
  
  <p>Any ideas how to do this in swift?</p>