Edytuj

Udostępnij za pośrednictwem


CMAccelerometerHandler Delegate

Definition

A delegate signature used to receive events from CMMotionManager

public delegate void CMAccelerometerHandler(CMAccelerometerData data, NSError error);
type CMAccelerometerHandler = delegate of CMAccelerometerData * NSError -> unit

Parameters

data
CMAccelerometerData

The accelerometer data for this event.

error
NSError

An error, or null if there have been no errors.

Remarks

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

var motionManager = new CMMotionManager ();
motionManager.AccelerometerUpdateInterval = 0.01; // 100Hz
motionManager.StartAccelerometerUpdates (NSOperationQueue.CurrentQueue, (data, error) => {
     Console.WriteLine ("Got an acceleration event {0}", data.Acceleration.X);
});

Applies to