title: Swift: Argument type '[String:ValueType]' does not conform to expected type 'AnyObject'
body: <p>I have following code trying to convert a dictionary to NSData:</p>
  
  <pre><code>func dataFromDict&lt;ValueType&gt;(dict: [String:ValueType]) -&gt; NSData {
      return NSKeyedArchiver.archivedDataWithRootObject(dict)
  }
  </code></pre>
  
  <p>The compiler gives me this error for passing <code>dict</code> as argument:</p>
  
  <p><code>Argument type '[String:ValueType]' does not conform to expected type 'AnyObject'</code></p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>@vadian's solution worked for me.</p>
  
  <p>I also tried to cast the dict to <code>NSDictionary</code>:</p>
  
  <pre><code>return NSKeyedArchiver.archivedDataWithRootObject(dict as NSDictionary)
  </code></pre>
  
  <p>But getting this error:</p>
  
  <p><code>Cannot convert value of type '[String:ValueType]' to type 'NSDictionary' in coercion</code></p>
  
  <p>Why?</p>