简体   繁体   中英

ios double click home button event

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.

  • It works well, but another problem occurs, when user pull down notification or other action make app resign active, it will show my passcode view, this lead user feel very annoy. So I just want to show passcode view whenever user home button or doubleclick home button. Does anyone have any idea?

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.

  1. Hardware independent = Like apps
  2. Hardware using = For Example Camera Apps (Using some type of core Frameworks)
  3. Hardware itself = NO permission to use that layer

The core frameworks give you the closes freature to code for the hardware.

IOS Frameworks

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.

ie 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...

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM