title: App crashes at reloadData() for Collectionview with a background fetch
body: <p>So I am doing a background fetch, and after I want to update the UI. The background fetching itself (database) works, but when I want to update the UI, I get a crash <code>unexpectedly found nil while unwrapping an Optional value</code>
  According to my xCode <code>self.newestPublicationsCollectionView.reloadData()</code> is where the crash occurs in the updateCollections() function.    </p>
  
  <pre><code> func updateCollections() {
          // get latest data from Database
          latestPublications = getNewestPublications()
  
          self.newestPublicationsCollectionView.reloadData()
  
          self.newestPublicationsCollectionView.layoutIfNeeded()
  
         // fix wrong content height
         self.newestPublicationsCollectionViewHeight.constant = self.newestPublicationsCollectionView.collectionViewLayout.collectionViewContentSize().height  
      }
  </code></pre>
  
  <p>Other code in the AppDelegate: </p>
  
  <pre><code>func application(application: UIApplication, performFetchWithCompletionHandler completionHandler: (UIBackgroundFetchResult) -&gt; Void) {
  
      let fetchViewController = PublicationOverviewController()
                  fetchViewController.fetch {
                      dispatch_async(dispatch_get_main_queue()) {
                      fetchViewController.updateCollections()
                      }
                      completionHandler(.NewData)
                  }
  }
  </code></pre>
  
  <p>The .fetch in my PublicationOverviewController</p>
  
  <pre><code>func fetch(completion: () -&gt; Void) {
      PublicationFetcher.shared.fetchAllPublications()
      completion()
  }
  </code></pre>
  
  <p>I thought the crash was because I needed the UI on the main thread, but that didn't help. Any input would be nice.</p>
  
  <p><strong>DETAILS:</strong></p>
  
  <p>In my PublicationFetcher.shared.fetchAllPublications() I do the following: </p>
  
  <ul>
  <li>get data from backend</li>
  <li><code>dispatch_async(dispatch_get_main_queue()) { () -&gt; Void in       NSNotificationCenter.defaultCenter().postNotificationName("RELOAD_NOTIFICATION", object: nil) }</code> </li>
  </ul>
  
  <p>and under that Reload Notification I do a <code>updateCollections()</code></p>
  
  <h2><strong>Swift 3</strong>:</h2>
  
  <pre><code>DispatchQueue.global(attributes: .qosBackground).async {
      print("This is run on the background queue")
  
      DispatchQueue.main.async {
          print("This is run on the main queue, after the previous code in outer block")
      }
  }
  </code></pre>