- (id)init{
self = [super init];
if (self) {
UITapGestureRecognizer* singleTap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(handleSingleTap:)];
[selfaddGestureRecognizer:singleTap];
singleTap.delegate =self;
singleTap.cancelsTouchesInView =NO;
[singleTap release];
}
return self;
}
// webView 不响应touch 时间
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[supertouchesBegan:touches withEvent:event];
CGPoint superPoint = [[touches anyObject]locationInView:self.superview];
CGPoint point = [[touches anyObject]locationInView:self];
NSLog(@"super %f,%f",superPoint.x,superPoint.y);
NSLog(@"%f,%f",point.x,point.y);
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
return YES;
}
-(void)handleSingleTap:(UITapGestureRecognizer *)sender{
CGPoint point = [sender locationInView:self];
NSLog(@"handleSingleTap!pointx:%f,y:%f",point.x,point.y);
}