title: How to pass a Type as a parameter in Swift
body: <p>I have a dictionary of objects and what I would like to do is go through the data set and return an array of objects that conform to a given protocol. I am having issues with the syntax for passing in a desired protocol:</p>
  
  <pre><code>func getObjectsThatConformTo&lt;T&gt;(conformance: T.Type) -&gt; [AnyClass]{
    var returnArray: [AnyClass] = []
    for(myKey, myValue) in allCreatedObjects{
      if let conformantObject = myValue as? conformance{
        returnArray.append(conformantObject)
      }
    return returnArray
  }
  </code></pre>
  
  <p>The error I am seeing is 'conformance' is not a type</p>
  
  <p>Thank you for your help and time</p>