title: How to pass an Array to function as a parameter in Swift?
body: <p>Am trying to pass an array as a parameter to a function. I tried as AnyObject and Generic T. Am not able to fix the issue. I have attached my tries to your reference.</p>
  
  <pre><code>Calling Function:
  parsedData(&amp;resultsArray)
  
  Function:
  with Generic
  func parsedData &lt;T&gt; (inout parsedResults : T) {
  
          print("ParsedResults: \(parsedResults)")
  
          let array = parsedResults
  
          let modelObj = array[0] as? DataModel
          print("Title: \(modelObj.title) Desc: \(modelObj.desc) Date: \(modelObj.date)")
  
      }
  
  without Generic:
  func parsedData (parsedReuslts: AnyObject) {
  
          print("ParsedResults: \(parsedReuslts)")
  
          let modelObj = array[0] as? DataModel
          print("Title: \(modelObj.title) Desc: \(modelObj.desc) Date: \(modelObj.date)")
  
      }
  
  Where am calling this func: parsedData(resultsArray)// Here am getting error message like "Cannot invoke 'parsedData' with an argument list of type '([Any])'"
  </code></pre>
  
  <p>Can anyone please help where am going in a wrong way? How to fix this issue? 
  Looking forward your help. Thanks in advance.</p>