CMDeviceMotionHandler Delegate

Definition

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);
});

Applies to