Skip to content

Instantly share code, notes, and snippets.

@Gringox
Last active January 28, 2019 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gringox/b9ff1eaadc40bf686d1df2b27b68d0a7 to your computer and use it in GitHub Desktop.
Save Gringox/b9ff1eaadc40bf686d1df2b27b68d0a7 to your computer and use it in GitHub Desktop.
+ (void)initialize {
if (!MACUSER) {
return;
}
Class class = [self class];
NSArray<NSString *> *originalSelectors = @[
@"doStuffOnSuccess:onFailure:",
@"doStuff1OnSuccess:onFailure:",
@"doStuff2OnSuccess:onFailure:",
@"doStuff3:onSuccess:onFailure:"
];
NSArray<NSString *> *swizzledSelectors = @[
@"appleReview_doStuffOnSuccess:onFailure:",
@"appleReview_doStuff1OnSuccess:onFailure:",
@"appleReview_doStuff2OnSuccess:onFailure:",
@"appleReview_doStuff3:onSuccess:onFailure:"
];
NSUInteger selectorsLength = originalSelectors.count;
for (int i = 0; i < selectorsLength; i++) {
SEL originalSelector = NSSelectorFromString(originalSelectors[i]);
SEL swizzledSelector = NSSelectorFromString(swizzledSelectors[i]);
Method originalMethod = class_getInstanceMethod(class, originalSelector);
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
method_exchangeImplementations(originalMethod, swizzledMethod);
}
}
@xhruso00
Copy link

xhruso00 commented Jan 5, 2019

How do you find when app is in review?

@Gringox
Copy link
Author

Gringox commented Jan 28, 2019

How do you find when app is in review?

Apple didn’t approve my app because it had a login screen and they were asking for credentials to test what was behind that screen. So, I knew the app was on review because they log in with the credentials I gave them. I check this in the line if (!MACUSER) {}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment