title: How To Handle json null values in Swift
body: <p>I am playing With JSON for last two days and facing alot of curious problems and thanks to stack overflow it helps me. This is JSON featured key has two types of String values. </p>
  
  <pre><code> "featured":"1"
  </code></pre>
  
  <p>or</p>
  
  <pre><code>"featured": null,
  </code></pre>
  
  <p>I tried a lot to handle this but failed</p>
  
  <p>Step 1:</p>
  
  <pre><code> if dict.objectForKey("featured") as? String != nil {
      featured = dict.objectForKey("featured") as? String
      }
  </code></pre>
  
  <p>Step 2:</p>
  
  <pre><code>    let null = NSNull()
      if dict.objectForKey("featured") as? String != null {
      featured = dict.objectForKey("featured") as? String
      }
  </code></pre>
  
  <p>Step 3:</p>
  
  <pre><code>    if dict.objectForKey("featured") as? String != "" {
      featured = dict.objectForKey("featured") as? String
      }
  </code></pre>
  
  <p>but unfortunately can't found solution, you answer will be appreciated. </p>