CMDeviceMotionHandler Delegate
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A delegate signature used to receive events from CMMotionManager
public delegate void CMDeviceMotionHandler(CMDeviceMotion motion, NSError error);
type CMDeviceMotionHandler = delegate of CMDeviceMotion * NSError -> unit
Parameters
- motion
- CMDeviceMotion
The device motion for this event (attitude, rotation rate and acceleration for the device).
- error
- NSError
The error if any, or null if there are no errors to report.
Remarks
This signature is used as an argument to the CMMotionManager's StartDeviceMotionUpdates.
For example:
var motionManager = new CMMotionManager ();
motionManager.AccelerometerUpdateInterval = 0.01; // 100Hz
motionManager.StartDeviceMotionUpdates (NSOperationQueue.CurrentQueue, (motion, error) => {
Console.WriteLine ("RotationRate={0} Gravity={1} UserAcceleration={2} Attitude={3}", motion.RotationRate, motion.Gravity, motion.UserAcceleration, motion.Attitude);
});