title: Challenge with ImageView with programatic segue
body: <p>I am having a real challenge within one of my Swift iOS projects that I just don't seem to be able to find a solution for. I was hoping that someone can both recreate my issue and maybe make suggestions as to a resolution or workaround.</p>
  
  <p>To summarize my issue:</p>
  
  <p>I have 2 view controllers within a storyboard. The first view controller contains 3 buttons and the second view controller simply contains an image view. I created a segue on the first button of the first view controller to the second view controller and when I click the button, it works perfectly.</p>
  
  <p>For my second button, I call the segue programmatically. First I assigned the segue an ID (MySegue) within the properties inspector, and then using a method within my view controller, I call the segue. When I click the second button, it works perfectly.</p>
  
  <pre><code>@IBAction func doSegue(sender: AnyObject) {
  
      self.performSegueWithIdentifier("MySegue", sender: nil)
  }
  </code></pre>
  
  <p>For my third button, I wanted to obtain some web data, and only upon success perform the segue. I am making use of NSURLSession to get the data with the completion handler performing the segue. My issue however is that when I click the third button, the Image View will not display no matter what I try. If I add buttons, labels or anything else, they display fine but not images. Here is my code for the button:</p>
  
  <pre><code>@IBAction func doNSURLSession(sender: AnyObject) {
  
      let requestURL: NSURL = NSURL(string: "https://www.google.com")!
      let urlRequest: NSMutableURLRequest = NSMutableURLRequest(URL: requestURL)
      let session = NSURLSession.sharedSession()
      let task = session.dataTaskWithRequest(urlRequest) {
          (data, response, error) -&gt; Void in
  
          if error == nil {
  
              NSLog("Success!")
              self.performSegueWithIdentifier("MySegue", sender: nil)
  
          } else {
  
              NSLog("Fail")
  
          }
  
      }
  
      task.resume()
  
  }
  </code></pre>
  
  <p>I have tried everything I possibly can to work around this issue. I can perform the segue programmatically within a method and it works fine however if I call this segue, or even call a method which calls this segue from the completion handler of the web request, the image view does not show. Does anyone have any ideas as to what I'm either doing wrong, or anywhere I could look?</p>
  
  <p>I have tried this both in XCode6 and the XCode 7 BETA, both have the same result too...</p>
  
  <p>Thanks in advance for any help.</p>
  
  <p>Regards,
  Jon</p>