title: Pass in class type to be used with Object Mapper
body: <p>I am using the object mapper for swift and have run into a problem.</p>
  
  <p>I have a API class which does a call to the server and responds with a json response.</p>
  
  <p>Now when i call the dataTask function in this API class, i want to pass through the class type i want the json response to be  mapped to using Object mapper. </p>
  
  <pre><code>func dataTask(method: String, type: AnyClass) {
  
      Mapper&lt;AnyClass&gt;().map(response)
  
  }
  </code></pre>
  
  <p>I am not sure how I can pass in the class to be used with the mapper, I have tried generics but not sure if i implemented it correctly or not.</p>
  
  <pre><code>func dataTask&lt;T&gt;(method: String, type: T.type) {
  }
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks</p>