title: Remove Modal View Controller when Application becomes active
body: <p>In my app I have a button, when the user clicks it, it brings up a modal view controller which gets the user's location (with a <code>UIActivityIndicator</code> and image on). When it has there location it will send them off to another application.</p>
  
  <p>This works well on older devices (without multi-tasking) because the app simply re-launches back to it's previous state after I go back to it.</p>
  
  <p>However on devices that have multi-tasking, when I resume the app, the view that tells the user it's getting their location is still there - which is not at all desired.</p>
  
  <p>My first idea was to set a BOOL when it was about to fire them off to the other app, and then in the <code>viewDidAppear</code>, if the BOOL is true, dismiss the modal view.</p>
  
  <p>That would work, if <code>viewDidAppear</code> got called when an app resumes active. As I have just learnt, it doesn't.</p>
  
  <p>Is there a method that view controllers can respond to when the app resumes active to that view? Or, will I have to set up delegation etc with the app delegate? If so, can you explain how I would do that?</p>