Last active
November 22, 2020 18:13
-
-
Save username0x0a/bd3f7228bab7230ab926165fd126e77a to your computer and use it in GitHub Desktop.
Revisions
-
username0x0a revised this gist
Mar 16, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ @implementation SKStoreReviewDummyClass + (void)load { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ Class class = [self class]; -
username0x0a created this gist
Mar 16, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ @interface SKStoreReviewDummyClass : NSObject @end @implementation SKStoreReviewDummyClass + (void)load { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ Class class = [self class]; Class ratingClass = NSClassFromString(@"SKStoreReviewPresentationWindow"); SEL originalSelector = @selector(init); SEL swizzledSelector = @selector(xxx_init); Method oldMethod = class_getInstanceMethod(ratingClass, originalSelector); Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); class_addMethod(ratingClass, swizzledSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); swizzledMethod = class_getInstanceMethod(ratingClass, swizzledSelector); method_exchangeImplementations(oldMethod, swizzledMethod); }); } - (instancetype)xxx_init { NSLog(@"Star rating alert fired !!!!"); return [self xxx_init]; } @end