title: Class conforming to protocol as function parameter in Swift
body: <p>In Objective-C, it's possible to specify a class conforming to a protocol as a method parameter. For example, I could have a method that only allows a <code>UIViewController</code> that conforms to <code>UITableViewDataSource</code>:</p>
  
  <pre><code>- (void)foo:(UIViewController&lt;UITableViewDataSource&gt; *)vc;
  </code></pre>
  
  <p>I can't find a way to do this in Swift (perhaps it's not possible yet). You can specify multiple protocols using <code>func foo(obj: protocol&lt;P1, P2&gt;)</code>, but how do you require that the object is of a particular class as well?</p>