I have the following code for testing purposes:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self customTouchHandler:touches];
}
- (v
Cannot comment, so will answer here. You coud print all handlers like this, maybe it helps:
- (void)customTouchHandler:(NSSet *)touches
{
static int handlerCounter = 0;
handlerCounter++;
for(UITouch* touch in touches){
NSLog(@"%d: %d", handlerCounter, touch.phase);
if(touch.phase == UITouchPhaseBegan)
touchesStarted++;
if(touch.phase == UITouchPhaseEnded || touch.phase == UITouchPhaseCancelled)
touchesFinished++;
}
NSLog(@"%d / %d", touchesStarted, touchesFinished);
}
Is it possible to switch(touch.phase) in obj-c? Is the "or" in the second if evaluated correctly, try using brackts.