Skip to content

Instantly share code, notes, and snippets.

@marianolatorre
Created November 25, 2016 16:52
Show Gist options
  • Save marianolatorre/112092c9da9bb7459c37fdc527728070 to your computer and use it in GitHub Desktop.
Save marianolatorre/112092c9da9bb7459c37fdc527728070 to your computer and use it in GitHub Desktop.
@interface MyWindow : UIWindow
@end
@implementation MyWindow
- (void)sendEvent:(UIEvent *)event {
[super sendEvent:event];
NSSet *tocuhes = [event touchesForWindow:self];
for(UITouch *touch in tocuhes){
NSLog(@"XXXX For this view: %@",[touch.view class]);
UIView *view = [self hitTest:[touch locationInView:touch.view] withEvent:event];
NSLog(@"YYYY This will receive: %@",[view class]);
}
}
@end
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[MyWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment