title: Trying to fetch image URL in Swift using Google Image API
body: <p>I'm trying to use the google image API with JSON (<a href="https://developers.google.com/image-search/v1/jsondevguide" rel="nofollow">https://developers.google.com/image-search/v1/jsondevguide</a>) to get the URL of the first image that shows when searching something. This is what I have:</p>
  
  <pre><code>let placeName = "New York"
  
  func getImage() {
      let url = NSURL(string: "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&amp;q=\(placeName)")
      let request = NSURLRequest(URL: url!)
      NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue()){ (response, go, error) -&gt; Void in
      let go = NSJSONSerialization.JSONObjectWithData(go, options: NSJSONReadingOptions.AllowFragments, error: nil) as [String:AnyObject]
          let responseData = go["responseData"] as [String:AnyObject]
          // let results = responseData["results"] as [String:AnyObject]
          // let imageURL = results["unescapedUrl"] as String
          println(responseData)
  }
  }
  </code></pre>
  
  <p>The responseData part is as far as I can go (that then returns everything), but trying to go one level deeper (to "results") will crash it.</p>