Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Touch delay in iOS near left of the screen
Started by ivansolispadilla Dec 08 2019 03:50 PM

No replies to this topic
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Observer

  • 5 posts
  • Corona SDK

I created a "tap and hold" using a timer. I noticed the hold time seems a lot longer if touch is close to the left edge of the screen in portrait. Debugging I see that the touch 'began' is not received at all until a few milliseconds later. Or from another perspective: the time from 'began' to the timer callback is the correct time. So I am sure my logic is correct and what happens is the first touch 'began' is delayed.


Digging a bit found that apparently this is a known odd behavior on iOS,  and the recommendation is to set delaysTouchesBegan to false according to a couple of stack overflow posts I am linking below.


Is there a plan to add this delaysTouchesBegan to Corona? Or, is there a known workaround besides blocking the edge of the screen from the user?


A single tap seems to work fine. I guess once some gesture recognizer in iOS finds that it will do nothing with the touch event; the event is forwarded to the rest of the app and can be handled normally. So this is only an issue for my "tap and hold" logic.


This is important because trying to go fast with a mix of taps and tap and holds one tends to learn the timing and not wait more than necessary. So a tap and hold with the expected timing becomes a tap from the Lua code perspective and the user loses the game.