Hi,
I have one Masterview.it has lot of childviews.I am using the following code to detect the touched view and to bring front the corresponding view.the code works fine.But When I add subview to childview,it did not work , any help please?
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
{
self.hitView = nil;
self.hitView = [super hitTest:point withEvent:event];
int x = self.hitView.frame.origin.x;
int y = self.hitView.frame.origin.y;
NSLog(@"x = %d",x);
NSLog(@"y = %d",y);
if ([self.viewDelegate respondsToSelector:
@selector(view:hitTest:withEvent:hitView:)])
{
return [self.viewDelegate view:self hitTest:point
withEvent:event hitView:hitView];
}
else
{
[self bringSubviewToFront:self.hitView];
return hitView;
}
}