// here Tiles is a separate class inherited from UIView Class - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; if ([[touch view] isKindOfClass:[Tiles class]]) { NSLog(@"[touch view].tag = %d", [touch view].tag); } }
like this, you can see that the view or under view has touched
User-1070892
source share