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上看到的視圖?