I have a simple question. I\'m trying to detect when a user shakes the iPhone. I have the standard code in place to detect the motion and this works no problem. However, in test
Use core motion. Link your binary with CoreMotion framework. Include #import in your class. Create an instance of CMMotionManager. Set the deviceMotionUpdateInterval property to a suitable value. Then call startDeviceMotionUpdatesToQueue. You will get continuous updates inside the block, which includes acceleration, magnetic field, rotation, etc. You will get the data you require. One thing to be taken care of is that the update shall be so rapid if the interval is too small, and hence you will have to employ suitable logic to handle the same.