_UISystemGestureManager

From iPhone Development Wiki
Revision as of 06:48, 30 June 2022 by Cynder (talk | contribs) (Created page with " The _UISystemGestureManager, introduced in iOS 13, handles gestures across the system. It can be used to add and remove custom gestures from SpringBoard. Header: https://he...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The _UISystemGestureManager, introduced in iOS 13, handles gestures across the system. It can be used to add and remove custom gestures from SpringBoard.


Header: https://headers.cynder.me/index.php?sdk=ios/15.4&fw=PrivateFrameworks/UIKitCore.framework&file=Headers/_UISystemGestureManager.h

Adding a Gesture Recognizer across all of SpringBoard

self.pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];

FBSDisplayIdentity *displayIdentity = [[[UIScreen mainScreen] displayConfiguration] identity];
[[_UISystemGestureManager sharedInstance] addGestureRecognizer:self.pinchGestureRecognizer toDisplayWithIdentity:displayIdentity];

Removing a Gesture Recognizer from the system

FBSDisplayIdentity *displayIdentity = [[[UIScreen mainScreen] displayConfiguration] identity];
[[_UISystemGestureManager sharedInstance] removeGestureRecognizer:self.pinchGestureRecognizer toDisplayWithIdentity:displayIdentity];