我修复了它,当一个刷卡被检测和处理,而不是不发送任何东西,我现在发送一个touchesCancelled,这是很有意义的回顾,我必须承认,但它不是真的很清楚,我应该这样做。如果您不想处理该操作,我找不到适当的文档说明该怎么办。
有效代码:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
moveCount = 0;
UITouch * touch = [touches anyObject];
touchBegin = [touch locationInView: nil];
[[self nextResponder] touchesBegan: touches withEvent: event];
}
- (void) touchesMoved: (NSSet * const)touches withEvent:(UIEvent * const)event {
moveCount++;
[[self nextResponder] touchesMoved: touches withEvent: event];
}
- (void) touchesEnded: (NSSet * const)touches withEvent:(UIEvent * const)event {
// If we DO NOT handle the touch, send touchesEnded
if(![self checkUserSwipedWithTouches: touches]){
[[self nextResponder] touchesEnded: touches withEvent: event];
} else { // If we DO handle the touch, send a touches cancelled.
self.selected = NO;
self.highlighted = NO;
[[self nextResponder] touchesCancelled: touches withEvent: event];
}
}