title: Swift - Convert [[String:Any?]] to Data
body: <p>I have an <code>[[String:Any]]</code> object populated like:</p>
  
  <p><code>var result : [[String : Any]] = [[String : Any]]()</code></p>
  
  <p>And I need convert it to <code>Data</code>.</p>
  
  <p>I'm just using: 
  <code>JSONEncoder().encode(result)</code>
  To convert it.</p>
  
  <p>But I get this error:</p>
  
  <blockquote>
    <p>Generic parameter 'T' could not be inferred</p>
  </blockquote>
  
  <p>Exist a simple way to convert a <code>[[String:Any?]] object to</code>Data` ?</p>