Last active
September 8, 2020 15:44
-
-
Save b3ll/8f1bf5de8e03263971febf0842433b5a to your computer and use it in GitHub Desktop.
Disables the 3-Finger Gestures in iOS 13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIUndoGestureRecognizerFixes.m | |
// no u | |
// | |
// Created by Adam Bell on 8/22/19. | |
// Copyright © 2019 Adam Bell. All rights reserved. | |
// | |
#import "UIUndoGestureRecognizerFixes.h" | |
#import <UIKit/UIKit.h> | |
#import <objc/runtime.h> | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wundeclared-selector" | |
@implementation UIUndoGestureRecognizerFixes | |
+ (void)load | |
{ | |
if (@available(iOS 13, *)) { | |
Class UIUndoGestureInteractionClass = NSClassFromString(@"UIUndoGestureInteraction"); | |
SEL addGestureRecognizersSelector = @selector(_addGestureRecognizers); | |
IMP doNothing = imp_implementationWithBlock(^void(id slef){ | |
return; | |
}); | |
method_setImplementation(class_getInstanceMethod(UIUndoGestureInteractionClass, addGestureRecognizersSelector), | |
doNothing); | |
} | |
} | |
@end | |
#pragma clang diagnostic pop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment