我需要在 touchesMoved 期间取消触摸事件,以便底层 uiviews 可以接收事件。请参阅下面的评论:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
for (UITouch *touch in touches)
{
if (touch.view == self.touchOverlay) {
CGPoint touchLocation = [touch locationInView:touch.view];
//perform checks on touch location and trip sensor if circumstances are met
if (self.touchSensorTripped) {
self.touchOverlay.userInteractionEnabled = NO;
//NEED TO CANCEL THE TOUCH HERE SO THAT VIEWS UNDERNEATH CAN RECEIVE THE TOUCH EVENTS
}
}
}
}
目前底层视图在触摸结束之前不会接收触摸事件,这为时已晚。一旦覆盖视图被禁用,我需要他们立即开始接收 touchesMoved 事件,而触摸仍在移动。我可以在上面的评论中插入什么来做到这一点?