title: How do I convert NSDictionary to Dictionary?
body: <p>I have already updated to XCode 8 and now I need to convert my code from Swift 2 to Swift 3.</p>
  
  <p>Before, when I want to convert <code>NSDictionary</code> to <code>Dictionary</code>, I just wrote the following:</p>
  
  <pre class="lang-swift prettyprint-override"><code>let post_paramsValue = post_params as? Dictionary&lt;String,AnyObject?&gt;
  </code></pre>
  
  <p>where <code>post_params</code> is <code>NSDictionary</code>.</p>
  
  <p>But now with Swift 3, I am receiving this error:</p>
  
  <pre><code>NSDictionary is not convertible to Dictionary
  </code></pre>
  
  <p>Why? What's changed?</p>
  
  <hr>
  
  <h3>Edit 1</h3>
  
  <p>I've also tried the following:</p>
  
  <pre><code>let post_paramsValue = post_params as Dictionary&lt;String,Any&gt;
  </code></pre>
  
  <p>But that gives this error:</p>
  
  <p><a href="https://i.stack.imgur.com/wXWJ9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wXWJ9.png" alt="&#39;NSDictionary!&#39; is not convertible to &#39;Dictionary&lt;String, Any&gt;&#39;; did you mean to use &lt;code&gt;as!&lt;/code&gt; to force downcast?"></a></p>
  
  <hr>
  
  <h3>Edit 2</h3>
  
  <p>I've also tried the following:</p>
  
  <pre><code>let post_paramsValue =  post_params as Dictionary&lt;String,Any&gt;
  </code></pre>
  
  <p>Where I declare <code>NSDictionary</code> instead of <code>NSDictionary!</code>, but it doesn't work; I got this error:</p>
  
  <p><a href="https://i.stack.imgur.com/qMeVH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qMeVH.png" alt="&#39;NSDictionary&#39; is not convertible to &#39;Dictionary&lt;String, Any&gt;&#39;; did you mean to use &lt;code&gt;as!&lt;/code&gt; to force downcast?"></a></p>
  
  <hr>
  
  <h3>Edit 3</h3>
  
  <p>I've also tried the following:</p>
  
  <pre><code>let post_paramsValue =  post_params as Dictionary&lt;String,Any&gt;!
  </code></pre>
  
  <p>But I received this error:</p>
  
  <p><a href="https://i.stack.imgur.com/GaeA8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GaeA8.png" alt="&#39;NSDictionary!&#39; is not convertible to &#39;Dictionary&lt;String, Any&gt;!&#39;; did you mean to use &lt;code&gt;as!&lt;/code&gt; to force downcast?"></a></p>