title: When do ViewControllers call deinit? During move to background? During move to suspended?
body: <p>I know that a <code>ViewController</code> will have its <code>deinit</code> method called once it is no longer needed (e.g. after an unwind segue and subsequent dismissal).</p>
  
  <p>But I was wondering what the behavior of <code>deinit</code> was in the context of the application lifecycle.</p>
  
  <h2>My questions</h2>
  
  <p>1) When (which app state active/inactive/background/etc), if at all, does <code>deinit</code> get called if the app is terminated by the system due to memory constraints  </p>
  
  <p>2) When (which app state active/inactive/background/etc), if at all, does <code>deinit</code> get called if the app is terminated by the user through the recently used app screen  </p>
  
  <p>3) When (which app state active/inactive/background/etc), if at all, does <code>deinit</code> get called if the app is moved to the background by the user accepting an incoming call</p>
  
  <p>4) When (which app state active/inactive/background/etc), if at all, does <code>deinit</code> get called if the app is moved to the background by the user opening a different app</p>