-1

I'm developing a swift game that involves a lot of finger-dragging through the whole screen. The problem is that with the new ios home "button-slide", I find myself out of the game when i get close to the bottom or the top of the screen.

I would like to add a doble tap enabling like Brawl Start has, you first need to tab the bottom bar, and only then it is available to swipe up.

Is it possible to implement?

Thank You.

Miki Mirat
  • 27
  • 3

1 Answers1

1

iOS 11 added the preferredScreenEdgesDeferringSystemGestures property to UIViewController:

Normally, the screen-edge gestures defined by the system take precedence over any gesture recognizers that you define. The system uses its gestures to implement system level behaviors, such as to display Control Center.

Whenever possible, you should allow the system gestures to take precedence. However, immersive apps can use this property to allow app-defined gestures to take precedence over the system gestures. You do that by overriding this property and returning the screen edges for which your gestures should take precedence.

If you change the edges preferred by your view controller, update the value of this property and call the setNeedsUpdateOfScreenEdgesDeferringSystemGestures() method to notify the system that the edges have changed.

Community
  • 1
  • 1
rob mayoff
  • 375,296
  • 67
  • 796
  • 848
  • Thank You! this is what i was looking for!. The probem i don't have the enough insight to figure how to call this function. It tells me it is a only get attribute. – Miki Mirat Apr 15 '19 at 09:48
  • “You do that by overriding this property and returning the screen edges…” – rob mayoff Apr 15 '19 at 15:32