Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you prevent Notification Center in games?

Tags:

ios7

In iOS7, swiping up from the bottom of the screen or down from the top of the screen slides a "glass screen" on top of the app you are using. In many games, it is very frustrating.

As a user, you can turn off this behavior in apps, but this is a system-wide change.

Angry Birds has small triangles pop up when a top/bottom swipe is detected, which is not a perfect fix, but something already.

Is there any better solution? What API/call to use?

like image 356
Kheldar Avatar asked Oct 03 '22 21:10

Kheldar


1 Answers

To get the same behaviour in iOS 11, you must implement preferredScreenEdgesDeferringSystemGestures on your view controller:

- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
    return UIRectEdgeAll;
}
like image 84
Jesús A. Álvarez Avatar answered Oct 12 '22 11:10

Jesús A. Álvarez