added files via upload

This commit is contained in:
Balackburn
2023-06-27 09:54:41 +02:00
commit 2ff6aac218
1420 changed files with 88898 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
//
// UIGestureRecognizer+Blocks.m
// FLEX
//
// Created by Tanner Bennett on 12/20/19.
// Copyright © 2020 FLEX Team. All rights reserved.
//
#import "UIGestureRecognizer+Blocks.h"
#import <objc/runtime.h>
@implementation UIGestureRecognizer (Blocks)
static void * actionKey;
+ (instancetype)flex_action:(GestureBlock)action {
UIGestureRecognizer *gesture = [[self alloc] initWithTarget:nil action:nil];
[gesture addTarget:gesture action:@selector(flex_invoke)];
gesture.flex_action = action;
return gesture;
}
- (void)flex_invoke {
self.flex_action(self);
}
- (GestureBlock)flex_action {
return objc_getAssociatedObject(self, &actionKey);
}
- (void)flex_setAction:(GestureBlock)action {
objc_setAssociatedObject(self, &actionKey, action, OBJC_ASSOCIATION_COPY);
}
@end