Swift 3: Cannot convert value of type 'NSMutableDictionary' to expected argument type '[AnyHashable : Any]!' : <p>This code worked before Swift 3. (Curse you Swift 3!)</p>

<p>Now it's showing this error against the <code>Flurry.logEvent(eventName, withParameters: userData!)</code> line:</p>

<blockquote>
  <p>Cannot convert value of type 'NSMutableDictionary' to expected
  argument type '[AnyHashable : Any]!'</p>
</blockquote>

<p>Casting <code>userData!</code> to <code>[AnyHashable : Any]</code> produces this error:</p>

<blockquote>
  <p>Cannot convert value of type 'NSMutableDictionary' to type
  '[AnyHashable : Any]' in coercion</p>
</blockquote>

<pre><code>func logEvent(_ eventName: String, userData: NSMutableDictionary?) {
    // Use &lt;userData&gt; or create new one?
    var userData = userData
    if userData == nil {
        userData = NSMutableDictionary()
    }

    // Set base properties
    userData!.setObject(gUser.tofus.count, forKey: "Num Tofus" as NSCopying)
    userData!.setObject(gUser.getLifetimeTofus(), forKey: "Num Lifetime Tofus" as NSCopying)

    // Call Flurry
    DispatchQueue.main.async {
        Flurry.logEvent(eventName, withParameters: userData! as [AnyHashable:Any])
    }
}
</code></pre>

<p>What's the right syntax for Swift 3?</p>
