Skip to content

Instantly share code, notes, and snippets.

@b3ll
Last active September 8, 2020 15:44
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b3ll/8f1bf5de8e03263971febf0842433b5a to your computer and use it in GitHub Desktop.
Save b3ll/8f1bf5de8e03263971febf0842433b5a to your computer and use it in GitHub Desktop.
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