Question

comment puis-je compter deux taps dans le simulateur?

Était-ce utile?

La solution

- (void) touchesBegan:(NSSet *) touches withEvent:(UIEvent *) event
{
    UITouch *touch = [touches anyObject];
    if (touch.tapCount == 2)
    {
        // do your stuff here
    }
}

Autres conseils

Implémentez l’une des fonctions tactiles définies dans UIResponder (touchesBegan, touchedEnded, etc ...). Lorsque vous obtenez le tableau de touches, vous pouvez obtenir le nombre de prises d'un UITouch en utilisant un code comme celui-ci:

UITouch * t = [touches anyObject];
NSLog(@"%d", [t tapCount]);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top