The GSRotationMotion class allows to handle shake rotation easily.
-
Import the GSRotationMotion.h and GSRotationMotion.m into your project.
-
make sure that the CoreMotion.framework and UIKit.framework is in the project
-
Implement "GSRotationMotionDelegate" in your header
-
Implement the method "finishedMotion" in the main class
-
start the the GSRotationMotion with: GSRotationMotion *motion = [[GSRotationMotion alloc] init]; motion.delegate = self; [motion startDetect];
-
For stopping it call the "[motion stopDetect]"