TapGestureRecognizer doesn't work at first tap

Hello,


My project deals with IOS 10.2 and the app user interface has been created using the interface builder through standard components to TapGesture Recognizer.

Every time i present a viewcontroller there is a very short timeframe where tap gesture recognizers are not triggering any action. If user wait few more miliseconds, the tap works right even at first time.


Through different forums i have read about the following options:

  • nest the call of "present view controllers" in main thread
  • Make a CFRunLoopWakeup before presentviewcontroller
  • Add programatically the TapGesturerecognizer and bind it to a variable
  • change the states of "delays touches end" and "delays touches began"


All above have been unsuccessful.


Anyone would have met similar issues with the first tap just after the view load?

Stephane

Answered by babarorhum in 229167022

Got the answer from stack overflow contributors . Setting to false the animation flag in either presentviewcontrollet or dismissviewcontroller remove the first tap problem .

Update: I realise this misbehaviour is not specific to this app. Two tests to try:

  • create an xCode Project for iPhone and two view controllers Controller A and Controller B. Two buttons : a button on Controller A view to go to Controller B view and a button Back in Controller B view to go back to Controller A view. Tap to go from View A to B, tap back in B and try immediately to tap on button to go to B. First tap doesn't work either.
  • Go in Settings of the iPhone. Tap On Notifications. Press On Settings to go back to Main Settings screen, Tap immediately back on Notifications. If fast enough, first tap doesn't work. Second tap works or waiting a bit before first tap.


Question is now: this looks like a common problem across iPhone apps. Would you know if there would be a common setting somewhere? or is this a common bug for given IOS version ?

Do you really speak of waiting a few more milliseconds ? No human being (at least not me 🙂) is capable of that fast action.


I did test the settings / notifications, and you're right. But to outspeed the system, I had to use 2 fingers: one for returning and the other prepositioned on Notifications ; not a very usual use case. That shows also that the UI design is good, because the situation cannot occur accidentally : in your case of 2 controllers, I suppose the buttons are at the same place on screen, leading to this acciodentla dual tap).


In fact, I do not find surprising that it is possible to outpace system reactions. Items are displayed first (to provide user with no delay display), but all elements are not yet in place (to intercept a tap).

IMHO, it is more hardware performance limit than a bug, and UI design should take this into consideration.

Hello,

Thank you for your insights and viewpoint.

It is in a short interval indeed but i am not sure I would call it milli-seconds though. 😉

The System Setting example presents similar First Tap behaviour than the New XCode Project example. They are indeed differences in terms of time intervals: the System Setting one has a much shorter timeframe for the bug to appear. My assumption would be that it highly depends on what type of content is being displayed and loaded.

Technical limitation or actual misbehaviour my challenge is that during the Friendly user testing rounds of the game, it was spotted by two different sources, one with testing background and the second one with a usability viewpoint. Both reported the problem and expressed their perception that the game is slow and the annoyance of tapping twice. Both reported scenarios such as the first tap on main screen (which is the first impression of user would have about the product) , or a second scenario was the first tap in the virtual shop (which is not the moment to degrage the user perception as one wants this transaction to be swift and smooth with not second thought being triggered by having to tap twice 😉). Also when considering players who uses the app frequently their taps would tend to become faster by habit, therefore the first tap behaviour would tend to become more and more dominant and being more and more anoying to them to the point of risking losing them. Personally I am looking for fluididty and intuitivity in products so that is the best and smoothest experience for players. That performance limitation/behaviour/ bug is a clear impediment. Thats why i am trying to find ways either to remove it or to go around it.

Back to the essence of the matter: one observation: I never have noted the first tap issue in other games. It brings me to a question: how is this being handled ? or is it worked around? Your thoughts are very welcome!

Accepted Answer

Got the answer from stack overflow contributors . Setting to false the animation flag in either presentviewcontrollet or dismissviewcontroller remove the first tap problem .

Thanks for the feedback.

TapGestureRecognizer doesn't work at first tap
 
 
Q