IOS: Detecting if touchEnded comes from sliding a screen or raising a finger?

In iOS, is there a way to tell when a touch ends, if it ends when it moves off the screen, or if the user lifts a finger?

I don’t know why, but I expected that the touch would be canceled when this happens, but it is not.

Thanks.

+6
source share
2 answers

This is the standard behavior of iOS, you can see it in any Apple application.

You can check if the touch has ended at the end of the screen and consider it as “cancel sliding,” but the user may want to slide so far.

My advice agrees with this because, as I said, this is standard behavior, and Apple tells us to stick with it - users expect standard behavior.

+4
source

Only through a deduction. If your finger moves to the edge of the screen and then touches its edge, you can be sure that the finger really slid off the screen. If he did not move immediately before the touch ended, the user probably just raised his finger.

+1
source

Source: https://habr.com/ru/post/918203/


All Articles