Skip to content

Instantly share code, notes, and snippets.

@OdNairy
Created October 23, 2014 15:45
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 OdNairy/5a2c78d5a8741fedc203 to your computer and use it in GitHub Desktop.
Save OdNairy/5a2c78d5a8741fedc203 to your computer and use it in GitHub Desktop.
@implementation UIWindow (WLOAnalytics)
+(void)load{
Class class = [UIWindow class];
SEL swizzleIt = @selector(sendEvent:);
SEL swizzleTo = @selector(WLORuntime_sendEvent:);
Method methodIt = class_getClassMethod(class, swizzleIt);
Method methodTo = class_getClassMethod(class, swizzleTo);
method_exchangeImplementations(methodIt, methodTo);
}
-(void)WLORuntime_sendEvent:(UIEvent *)event{
[self WLORuntime_sendEvent:event];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment