Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
UISystemGestureManager: Difference between revisions - iPhone Development Wiki

UISystemGestureManager: Difference between revisions

From iPhone Development Wiki
(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...")
 
(No difference)

Latest revision as of 06:48, 30 June 2022

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];