title: UIImage from URL not appearing in async block in Swift
body: <p>I am trying to set an image from a url to a UIImage using async blocks. I currently have one model class which is a wrapper for an API I built, which returns the url of the image. My View Controller's viewDidLoad function calls the method in my API model class, then, the API model class finds the url and calls a delegate method from my View Controller, printed below:</p>
  
  <pre><code>    func didReceiveNearPeopleResults(results: NSDictionary) {
      dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {
          var full_url = "http://s3-us-west-2.amazonaws.com/fake/112.jpg"
          var url = NSURL.URLWithString(full_url)
          var err: NSError?
          var request: NSURLRequest = NSURLRequest(URL: url)
          var urlConnection: NSURLConnection = NSURLConnection(request: request, delegate: self)
          var image: UIImage?
          NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue(), completionHandler: {(response: NSURLResponse!, data: NSData!, error: NSError!) -&gt; Void in
  
              var imgData = NSData(contentsOfURL: url)
              image = UIImage(data: data)
              self.picture.image = image
  
          })
  
      })
  
  
  }
  </code></pre>
  
  <p>However, the 'picture' in my view is not updated when the app runs. For debugging purposes, I hardcoded the url that should be in the image. If I assign the same code to a button, it works fine, and the image appears. Any help is appreciated.</p>