Trap closure of app when its closed in the Multi-Tasking view
It depends on the state your app is in:

If your app is suspended (i.e. it is in the background and not currently executing), there's no way of detecting the user closing the app.

If your app is backgrounded (i.e. it is in the background and executing), then your applicationWillTerminate method will be called.