In my app, I want to detect an upwards swipe. So of course, I added a UISwipeGestureRecognizer
to the view
of the view controller.
As expected, this recognizer detects swipe very well. But a bad thing about this is that a swipe from bottom edge is also detected. When the user wants to open the control center:
a swipe is also detected. I don't want this to happen.
In other words, I want to detect all upwards swipes except those from the bottom edge of the screen.
I think I can use a UIEdgePanGestureRecognizer
to detect an edge swipe as well. And when such a swipe is detected, disable the swipe recognizer. But this is barely possible right? Because who knows which recognizer detects a gesture first?
How can I do this?
P.S. I think I need to use requireGestureRecognizerToFail
, but the documentation is so bad I can't fully understand.