1
我有三个UIView
实例:的touchesBegan在特定的UIView
UIView *view1;
UIView *view2;
UIView *view3;
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch =[touches anyObject];
CGPoint startPoint =[touch locationInView:self.view];
}
但我想的是,TOCH行动只在视图2去。它不工作,如果我做:locationInView:view2
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch =[touches anyObject];
CGPoint startPoint =[touch locationInView:view2];
}
我该怎么做?我如何检查,哪个视图是我实际上可以在我的iphone上看到的视图?