Reputation: 1
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
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