title: How to check if NSDictionary is not nil in Swift 2
body: <p>I'm getting NSDictionary as parameter in my function but having problem because don't know how to check if that parameter is not nil.</p>
  
  <p>My function looks like this:</p>
  
  <pre><code>func doSmth(val : NSDictionary)
  </code></pre>
  
  <p>Inside my function I'm trying to get some values:</p>
  
  <pre><code>let action = val["action"] as! String
  </code></pre>
  
  <p>But getting error "fatal error: unexpectedly found nil while unwrapping an Optional value" when receive parameter val as nil.</p>