I have the following code for testing purposes:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self customTouchHandler:touches];
}
- (v
If you are using more than one finger you should include self.view.multipleTouchEnabled = YES;
in your init
.
I ran some extensive tests on your supplied code and the only time the numbers do not match up is when the taping occurs very fast from a combination of either one or both fingers. In this case, iOS looses track of the contact the current state.
This is very similar to when a sprite bounces up and down very quickly on another sprite which sometimes causes a wrong contact state in the didBeginContact.
There is currently no way you can get around this using multiple touches. If you use a single touch, your count will always (at least in my tests) match.