CoreMotion.CMDeviceMotionHandler Delegate
A delegate signature used to receive events from CoreMotion.CMMotionManager

Syntax

public delegate void CMDeviceMotionHandler (CMDeviceMotion motion, Foundation.NSError error)

Parameters

motion
The device motion for this event (attitude, rotation rate and acceleration for the device).
error
The error if any, or null if there are no errors to report.

Remarks

This signature is used as an argument to the CoreMotion.CMMotionManager's StartDeviceMotionUpdates.

For example:

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

Requirements

Namespace: CoreMotion
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0