title: Getting specific JSON values in swift
body: <p>I have a small app and in one of the buttons it retrieves a JSON file from online and it prints the result, but how can I utilize the JSON result, for example, rather than having to print to print an entire JSON, I want to print just one of the values, such as JSON["data"][1].</p>
  
  <p>Here is my code:</p>
  
  <pre><code>  @IBAction func approveuser(sender: AnyObject) {
          let postEndpoint: String = "https://example.com/example.json"
          let url = NSURL(string: postEndpoint)!
          let session = NSURLSession.sharedSession()
          let postParams : [String: AnyObject] = ["UUID": UIDevice.currentDevice().identifierForVendor!.UUIDString, "requested": place]
          let request = NSMutableURLRequest(URL: url)
          request.HTTPMethod = "POST" //can be changed.
          request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type")
          do {
              request.HTTPBody = try NSJSONSerialization.dataWithJSONObject(postParams, options: NSJSONWritingOptions())
              print(postParams)
          } catch {
              print("bad things happened")
          }
          session.dataTaskWithRequest(request, completionHandler: { ( data: NSData?, response: NSURLResponse?, error: NSError?) -&gt; Void in
              guard let realResponse = response as? NSHTTPURLResponse where
                  realResponse.statusCode == 200 else {
                      print("Not a 200 response")
                      return
              }
  
  
  
              // Read the JSON
              if let postString = NSString(data:data!, encoding: NSUTF8StringEncoding) as? String {
                  print("POST: " + postString)
                  //
              }
          }).resume()
  
      }
  </code></pre>