title: Dismiss ViewController AND reload previous / pass data back?
body: <p>My app downloads updates from a server. To do this it compares the data on the device with what is available on the server. If there is a mismatch, a Boolean 'updateAvailable' is set to true, and an interactive UILabel is shown to the user indicating they can download the update.</p>
  
  <p>(Slightly Simplified Code)
  <br><br></p>
  
  <pre><code>class ViewController: UIViewController {
  
  @IBOutlet weak var updateLabel: UILabel!
  
  func updateChecker(){
      let deviceVersion = self.settingsController.getDeviceVersion()
  
      //Get Server Version (Async)
      _ = settingsController.getServerVersion() { (data) -&gt; () in
  
          dispatch_async(dispatch_get_main_queue()){
  
              if deviceVersion != data{
                  self.updateAvailable = true
              }
              else{
                  self.updateAvailable = false
              }
  
              //Update UI
              self.updateUI()    
           }
      }
  }
  
  func updateUI(){
      if updateAvailable{
          updateLabel.text = "Update Available"
      }
      else{
          updateLabel.text = "App Up To Date"
      }
  }
  </code></pre>
  
  <p><br>
  On touching this update label, the app triggers a custom segue to the 'updateViewController':
  <br><br></p>
  
  <pre><code> @IBAction func getUpdateLabelPressed(sender: UITapGestureRecognizer) {
      if updateAvailable{
          self.performSegueWithIdentifier("segueToUpdateView", sender: self)
      }
  </code></pre>
  
  <p><br><br>
  The UpdateViewController downloads data from the server (async) and is then dismissed:</p>
  
  <pre><code>class UpdateViewController: UIViewController{
  override func viewDidLoad() {
      super.viewDidLoad()        
  
      //Create Settings Controller + Get Update        
      let sc = SettingsController()
      sc.getUpdate({ (success) -&gt; () in
  
          if success{
              dispatch_async(dispatch_get_main_queue()){    
              print("Update Success")
              self.dismissViewControllerAnimated(true, completion: nil)       
              }
           }
          else{   
              dispatch_async(dispatch_get_main_queue()){    
              print("Update Failed")
              self.dismissViewControllerAnimated(true, completion: nil)
              }
          }
       })       
  }
  </code></pre>
  
  <p><br></p>
  
  <p>On dismissal of the UpdateViewController, the main ViewController is shown, however 'updateAvailable' is still set to true, and the updateLabel is still active.</p>
  
  <p>Triggering another custom Segue back to the ViewController / Root ViewController is not an option for me, as this breaks background update fetching by creating more than one instance of 'ViewController' in the Stack.</p>
  
  <p>onViewDidAppear() is also inappropriate in this case, as it would cause heavy network / server traffic.</p>
  
  <p>How can I can dismiss the UpdateViewController <strong>AND</strong> Reload the previous ViewController <strong>OR</strong> Send back data that triggers ViewController's updateChecker() method? <strong>OR</strong> clear the entire ViewControllerStack and restart the app?</p>
  
  <p>I understand that delegate arrangement seems appropriate, but the previous SO questions and answers on this topic such as <a href="https://stackoverflow.com/questions/6203799/dismissmodalviewcontroller-and-pass-data-back">this one</a> are for Objective-C, and I have not been able to adapt these answers for Swift 2.0.</p>
  
  <p>Any help would be greatly appreciated.</p>