当有两个触摸落在不同的子视图上时,我想在superview中处理触摸事件。
我可以通过将UITapGestureRecognizer
numberOfTouchesRequired =2;
与目标self
添加到子视图来以某种方式实现吗?
或者我需要更复杂的事情?
答案 0 :(得分:0)
您可以尝试这样的事情:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = touches.anyObject;
CGPoint referencePoint = [touch locationInView:self.view];
if([touch tapCount] == 2){
//Test touch coordinates to see if theres one in each view
}