- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[selftouchPoint:toucheswithEvent:event];
[supertouchesBegan:toucheswithEvent:event];
}
- (void)touchPoint:(NSSet *)touches withEvent:(UIEvent *)event
{
//Get the point user touched
UITouch *touch = [touchesanyObject];
// 关键代码
CGPoint touchPoint = [touchlocationInView:self];
UIView *subview = [selfhitTest:touchPointwithEvent:nil];
if ([subviewisKindOfClass:[PNBarclass]] && [self.delegaterespondsToSelector:@selector(userClickedOnBarAtIndex:)]) {
[self.delegateuserClickedOnBarAtIndex:subview.tag];
}
}