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
// if | |
let a = 3 | |
let b = 3 | |
let c = 5 | |
// else if | |
// let a = 3 | |
// let b = 5 | |
// let c = 5 |
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
#import <objc/runtime.h> | |
#define HookMethod(cls_, sel_, ...) \ | |
(^{ \ | |
SEL _cmd = sel_; \ | |
__block IMP __original = method_setImplementation(class_getInstanceMethod(cls_, _cmd), imp_implementationWithBlock(__VA_ARGS__)); \ | |
})() | |
#define CallOriginal(...) \ |
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
#include <objc/runtime.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include "SwizzleMyNizzleProtocol.h" | |
IMP SwizzleMethod(Class _class, SEL sel, IMP imp) { | |
if (_class == nil || sel == NULL || imp == NULL) | |
return NULL; |