title: How to reload UIViewController data from App Delegate
body: <p>I have some methods that I am calling from the appDelegate to sync changes with persistent storage and iCloud. </p>
  
  <p>The methods and the appDelegate work fine, my app syncs changes fine; <strong>however</strong> when the app is <code>mergingChanges</code> and <code>persistentStoreDidChange</code> I am trying to refresh the <code>view controller</code> data and change the <code>view controller title</code> to syncing. </p>
  
  <p>I have tried changing the <code>UIViewController</code> title text and it does not change when merging or <code>persistentStoreWillChange</code>, also when using the <code>reloadData()</code> method for the view controller collection the app crashes with an unexpected nil when unwrapping an optional value. </p>
  
  <p>The thing is the project has many <code>tableview</code> &amp; <code>colectionview</code> all within a <code>UITabController</code> so I really need a refresh the data of the <code>view controller</code> in the window not just one specific view. Does anybody know how to refresh the <code>viewcontroller</code> data from the <code>appDelegate</code> ? </p>
  
  <pre><code>func mergeChanges(notification: NSNotification) {
      NSLog("mergeChanges notif:\(notification)")
      if let moc = managedObjectContext {
          moc.performBlock {
              moc.mergeChangesFromContextDidSaveNotification(notification)
              self.postRefetchDatabaseNotification()
          }
      }
      let vc = CollectionViewController()
      let view = self.window?.rootViewController
  
      vc.title = "Syncing"
      view?.title = "Syncing"
  }
  
  func persistentStoreDidImportUbiquitousContentChanges(notification: NSNotification) {
      self.mergeChanges(notification);
  }
  
  func storesWillChange(notification: NSNotification) {
      NSLog("storesWillChange notif:\(notification)");
      if let moc = self.managedObjectContext {
          moc.performBlockAndWait {
              var error: NSError? = nil;
              if moc.hasChanges &amp;&amp; !moc.save(&amp;error) {
                  NSLog("Save error: \(error)");
              } else {
                  // drop any managed objects
              }
  
              moc.reset();
          }
  
         let vc = CollectionViewController()
         vc.title = "Syncing"
  
          // reset UI to be prepared for a totally different
          // don't load any new data yet.
      }
  }
  
  func storesDidChange(notification: NSNotification) {
      // here is when you can refresh your UI and
      // load new data from the new store
      let vc = CollectionViewController()
      // vc.collectionView.reloadData()
  
      NSLog("storesDidChange posting notif");
      self.postRefetchDatabaseNotification();
  }
  </code></pre>