June 2011
Intermediate to advanced
590 pages
19h 31m
English
To detect when the user is shaking the device, you could perform some intricate math on the signal that comes from the accelerometer. However, the class UIResponder has been kind enough to implement methods that do the math for you.
// Triggered when a shake is detected - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event; // Triggered when the shake is complete - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event; // Triggered when ...
Read now
Unlock full access