iOS : détection de la zone de touche


21 octobre 2012

Comment détecter la zone (circulaire) d'une touche sur les iBidules ? Il faut obtenir un UITouch depuis un UIEvent et à partir de là :

float vf = 10.0;
    id valFloat = [thisTouch valueForKey:"pathMajorRadius"];
    if (valFloat != nil)    { vf = [valFloat floatValue]; }

Source : http://stackoverflow.com/questions/5179426/tap-pressure-strength-detection-using-accelerometer

Accueil