Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disables the 3-Finger Gestures in iOS 13
//
// 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
You can’t perform that action at this time.