Reputation: 840
Is there anyway to capture double click home button event.
I know it will run into applicationWillResignActive, but there are many situations that application will run into applicationWillResignActive so I can NOT distinguish the double click home button event with other events.
Can anybody give me some hints?
My app is meeting a bug: - On iOS 7, when double click home button, you can see running app with their current images. Because my app have some protection (I built a passcode view), so when user home button or double click home button, I will capture event to show my passcode view first. To do this, I place my code to show passcode on applicationWillResignActive.
Upvotes: 1
Views: 3140
Reputation: 1377
No there is not.
Apple just don't allow you to access their hardware. The only thing you can do is to use frameworks to accsess those hardware. If there isn't any framework for that, there is just no way to do this without coding for jailbreak or something.
You can think about layers of the software.
The core frameworks give you the closes freature to code for the hardware.
Upvotes: 3
Reputation: 53111
There's no way of specifically detecting a double tap on the home button.
As you note, you should respond to applicationWillResignActive
.
What are you actually trying to achieve?
Upvotes: 2
Reputation: 77631
You can't access any button clicks on the home button.
When it goes into applicationWillResignActive
that's as a secondary result of the button click. Not a direct result.
i.e. the button is clicked, the OS interprets the click, then tells your app to go into background, then you get applicationWillResignActive
.
Same when you receive a phone call etc...
Upvotes: 2