Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS detect drag outside left edge of screen

In iPad when you put your finger outside top or bottom edge of screen and then drag it on screen a menu is revealed. How can I implement that?

like image 633
AYMADA Avatar asked Feb 14 '23 09:02

AYMADA


1 Answers

  • There is specifically a Gesture Recogniser class for this, introduced in iOS 7. It's the UIScreenEdgePanGestureRecognizer. The documentation for it is here. Check it out.

  • To test this in the simulator, just start the drag from near the edge (~15 points).

  • Also, you will have to create a gestureRecognizer for each edge. You can't OR edges together, so UIRectEdgeAll won't work.

There is a simple example here. Hope this helps!

like image 67
aksh1t Avatar answered Feb 16 '23 02:02

aksh1t