title: Swift - How to loop through NSDictionary
body: <p>Hi I'm currently learning Swift, and I wanted to extract data from a JSON Api, My Swift code looks like this. To be specific, I need to extract each and every key and its value,(for example: print the value of title, cover etc..)</p>
  
  <pre><code>//Json request
  var error: NSError?
  var raw = NSString.stringWithString("http://example.com/MovieAPI/api/v1/movies/")
  var api_url = NSURL.URLWithString(raw)
  let jsonData: NSData = NSData.dataWithContentsOfURL(api_url, options: nil, error: &amp;error)
  let result = NSJSONSerialization.JSONObjectWithData(jsonData, options: nil, error: &amp;error)
  as NSDictionary
  for val in result {
     for (var i=0; i &lt; val.value.count; i++){
         //println(val.value.valueAtIndex(3)) Not Working
     }
  }
  </code></pre>
  
  <p>and the structure of my JSON is</p>
  
  <pre><code>{
    data: [
        {
          id: 2,
          title: "Hunger Games",
          cover: "http://example.com",
          genre: 2
         }
    ]
  }
  </code></pre>
  
  <p>Help!</p>