Upvote:2

Aprove answer
view = [frontMostWindow hitTest:p withEvent:event];

Upvote:0

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    NSLog(@" ");
    NSLog(@"Point: %@ Event: %p\n", NSStringFromCGPoint(point), event);
    UIView *view = nil;
    
    UIView *resultView = [super hitTest:point withEvent:event];
    
    if (resultView == self) {
        NSLog(@"touched in transparent window !!");
        return nil;
    }

    NSLog(@"touched in view!!");
    return resultView;
 }

Credit Goes to: stackoverflow.com

Related question with same questions but different answers