Mrunalini Deshmukh
Mrunalini Deshmukh

Reputation: 1

Shaking Continously for X Number of Seconds

I want for the program to detect the iPhone shaking for 20 seconds without stopping, and then do something. Is this possible? Any help would be appreciated!

Upvotes: 0

Views: 27

Answers (1)

Doug Watkins
Doug Watkins

Reputation: 1448

Start a timer when the shake gesture starts and end it when the gesture finishes or is canceled. Then compare that time to your desired length to see if your other code should run. See the apple docs here for more information.

Upvotes: 1

Related Questions