Skip to content

Instantly share code, notes, and snippets.

@ozcanzaferayan
Created February 4, 2020 22:35
Show Gist options
  • Save ozcanzaferayan/f35804d03c836da26e72dd9efa0314e7 to your computer and use it in GitHub Desktop.
Save ozcanzaferayan/f35804d03c836da26e72dd9efa0314e7 to your computer and use it in GitHub Desktop.
unsigned int methodCount;
Method *methods = class_copyMethodList(moduleClass, &methodCount);
for (unsigned int i = 0; i < methodCount; i++) {
Method method = methods[i];
SEL selector = method_getName(method);
if ([NSStringFromSelector(selector) hasPrefix:@"__rct_export__"]) {
IMP imp = method_getImplementation(method);
NSArray *entries = ((NSArray *(*)(id, SEL))imp)(_moduleClass, selector);
//...
[moduleMethods addObject:/* Object representing the method */];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment