Apple is really funny. I mean, they say that this works:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch* touch = [touches any
use this
[super.nextResponder touchesBegan:touches withEvent:event];
before this line in your code
[self.nextResponder touchesBegan:touches withEvent:event];
it means
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch* touch = [touches anyObject];
NSUInteger numTaps = [touch tapCount];
if (numTaps < 2) {
[super.nextResponder touchesBegan:touches withEvent:event];
[self.nextResponder touchesBegan:touches withEvent:event];
} else {
[self handleDoubleTap:touch];
}
}
**Swift 4 Version **
func touchesBegan(_ touches: Set, with event: UIEvent) {
let touch = touches?.first as? UITouch
let numTaps: Int? = touch?.tapCount
if (numTaps ?? 0) < 2 {
if let aTouches = touches as? Set {
super.next?.touchesBegan(aTouches, with: event)
next?.touchesBegan(aTouches, with: event)
}
} else {
handleDoubleTap(touch)
}
}