title: Swift: tableView.reloadData() way too slow
body: <p>I'm trying to execute a <code>tableView.reloadData()</code> call after an async request that I'm calling to populate my <code>UITableView</code>. The table displays the data after 15-20 seconds, unless I manually start scrolling, in which case it all loads immediately. So the data is definitely there, it's just not being loaded properly. What can I do to resolve this?</p>
  
  <pre><code>var jsonLoaded:Bool = false {
          didSet {
              if jsonLoaded {
  
                  tableView.reloadData()
  
              }
          }
      }
  
  override func viewDidLoad() {
          super.viewDidLoad()
  
  let url = NSURL(string: "https://www.googleapis.com/youtube/v3/search?part=id&amp;q=\(searchTerm)&amp;maxResults=1&amp;key=AIzaSyD7PxAoq0O5hUxx775l_E_mnowlU4cUfcI")
  
              let task = NSURLSession.sharedSession().dataTaskWithURL(url!, completionHandler: {data, response, error -&gt; Void in
  
                  if error != nil {
  
                      println(error)
  
                  } else {
  
                      let jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: nil) as! NSDictionary
  
                      if let items = jsonResult["items"] as? NSArray {
                          for songs in items {
                              if let id = songs["id"] as? NSDictionary {
                                  if let videoId = id["videoId"] as? String {
  let newURL = NSURL(string: "https://www.googleapis.com/youtube/v3/search?relatedToVideoId=\(videoId)&amp;part=snippet&amp;type=video&amp;maxResults=6&amp;key=AIzaSyD7PxAoq0O5hUxx775l_E_mnowlU4cUfcI")
  
                                      let newTask = NSURLSession.sharedSession().dataTaskWithURL(newURL!, completionHandler: {data, response, error -&gt; Void in
  
                                          if error != nil {
  
                                              println(error)
  
                                          } else {
  
                                              let newJsonResult = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: nil) as! NSDictionary
                                              if let info = newJsonResult["items"] as? NSArray {
                                                  for videos in info {
                                                      if let snippet = videos["snippet"] as? NSDictionary {
                                                          if let title = snippet["title"] as? String {
                                                             self.recommendedTitles.append(title)
                                                             self.jsonLoaded = true
  
                                                       }
                                                  }
                                             } 
                                        }
                                    })
                                    newTask.resume()
                                }
                            }
                       }
                   jsonLoaded = false
               }
            }
        }
    })
  }
  }
  </code></pre>