Mc.Lover
Mc.Lover

Reputation: 4994

How to detect iphone shake gesture one time !

hi i want iphone detect shake gesture only one time .

after iphone had been shaken and html files showed , then i want iphone doesn't detect shake anymore .

here is my code :

- (void)accelerometer:(UIAccelerometer *)accelerometer 
        didAccelerate:(UIAcceleration *)acceleration {
    {
        if (acceleration.x > kAccelerationThreshold 
            || acceleration.y > kAccelerationThreshold
            || acceleration.z > kAccelerationThreshold) {


        }
    }
}

Upvotes: 1

Views: 2029

Answers (1)

zaph
zaph

Reputation: 112857

Remove the delegate:

[UIAccelerometer sharedAccelerometer].delegate = nil;

Upvotes: 3

Related Questions