Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButtons in specific zone of the screen make delay on Touch Down event

I'm creating a Custom Keyboard for iOS. I have 4 rows of keys, each key have two actions: Touch Down to highlight button, and Touch Up Inside to unhighlight the button in 0.4 seconds. But at the left edge of the screen there is a zone where Touch Down event of any button makes a delay for about quarter of second to show highlight. See the image So to see highlighted version, I had to hold the button, or swipe right from it. The buttons are the same, no difference at all. When I switch from letters to symbols, this left edge zone also makes the same delay. I've tried to move all the keys to the right, about 20px, and they worked fine, without delay. Ok, stick to the edge back, and delay came back also. Then I noticed, that pressing the button on its right edge, about 1-2 pixels made no delay at all. So, it seems like the problem is in this left side edge zone of the screen particularly. By the way, I am running this app on my 5S, I've tried to run it on my friend's 5C, the same problem. But when I run it in the simulator, there is no such delay.

like image 424
zangar777 Avatar asked Dec 19 '25 12:12

zangar777


1 Answers

Use new iOS 11 feature to solve this problem definitely.

var preferredScreenEdgesDeferringSystemGestures: UIRectEdge { get }

Documentation

like image 135
Bigyelow Avatar answered Dec 21 '25 03:12

Bigyelow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!