Can we use "double tap" feature in iOS?

Hello developer community!
I am working on an iMessage extension and I want to know that can we use the double tap feature in iOS (when the screen is turned on and iMessage app is opened) ? If yes than how to make it work inside the code?
Thanks in advance.

Replies

Yeah, gesture recognizers will work. I used some pan gestures in one of my apps. I think the only thing to watch out for is swipe left / rights because in compact mode, those will always switch to the next/previous app. But I don't see why double tap gestures wouldn't work.

Thanks. It would be so kind of you if you guide me a little about using gestures without our iMessage app being opened at the moment but "running in the backgroung" ?

Running in the background it could listen for certain events but, those events would need to be ignored by the active app to pass them on. Put another way, you can't expect code running in your app to ever be executed unless it is the current active app.

You seem to be misunderstanding.


If you're writing an Messages Extension, that's not "running in the background", that's running as an extension and subject to the rules of being an app extension. But the views that you implement for your app extension can respond to double taps.


If your messages app isn't open, and your extension isn't visible, there's nothing for your app or the extension to respond to.

Agreed with NotMyName. I thought Muhammad was just referring to simple gesture recognizers

Thanks guys for your time 🙂