title: Call viewWillDisappear when user quits application ios
body: <p>I have an application that stores values in the <code>viewWillDisappear</code> method in one of my classes. For example, I store the data and time in the <code>viewWillAppear</code> method and the same again when in the <code>viewWillDisappear</code> method so I'm able to compare the time difference and log this out.</p>
  
  <p>However, if the user presses the home button on the device, then the <code>viewWillDisappear</code> code is not run. I've tried to call this particular method in the <code>AppDelegate</code>'s <code>applicationDidEnterBackground</code>, but this stores the wrong information as the <code>viewWillDisappear</code> method isn't actually run. I've also tried to store them in <code>NSUserDefaults</code>, but again, as the <code>viewWillDisappear</code> method isn't run, then the wrong values are stored.</p>
  
  <p>Is there a way to make the <code>viewWillDisappear</code> method run for that view as soon as the user presses their home button?</p>