tags:

views:

89

answers:

2

Is it possible to override the default behavior (close app) of the Home Button? And if how do you do that?

A: 

Even if it is possible, your app will probably not be approved by Apple. Are you planning this feature for your own private App or do you want to distribute it later on? The home button is probably the most critical button on the device on not a good idea to change

hecta
A: 

well, there's a reasonable alt to the need to detect if the Home button was tapped. i'm currently working on just such a scenario.

my app allows user input (into UITextViews). a customer has asked for an "autosave" feature where, should they (accidentally) tap the Home button during data entry, could i still capture the data entered and save it.

my testing of the sequence of viewWillDisappear in the view that is collecting the data and applicationWillTerminate show viewWillDisappear getting called before applicationWillTerminate. now i fully appreciate that this is the architected sequence Apple intended, BUT this sequence also precludes setting a simple Boolean in applicationWillTerminate to let the particular viewWillDisappear know that it is disappearing specifically due to applicationWillTerminate.

so the issue still stands. how can a UIView detect that it is disappearing specifically as a result of the app terminating?

crm357