iOS Guides | Samples

MonoTouch.UIKit.UIAcceleration Class

A class that stores the data from an acceleration event.

See Also: UIAcceleration


[MonoTouch.Foundation.Register("UIAcceleration", true)]
[MonoTouch.ObjCRuntime.Deprecated(MonoTouch.ObjCRuntime.PlatformName.iOS, 5, 0, MonoTouch.ObjCRuntime.PlatformArchitecture.None, "Use 'CoreMotion' instead.")]
[MonoTouch.ObjCRuntime.Introduced(MonoTouch.ObjCRuntime.PlatformName.iOS, 2, 0, MonoTouch.ObjCRuntime.PlatformArchitecture.None, "Use 'CoreMotion' instead.")]
[MonoTouch.ObjCRuntime.Unavailable(MonoTouch.ObjCRuntime.PlatformName.TvOS, MonoTouch.ObjCRuntime.PlatformArchitecture.All, null)]
public class UIAcceleration : NSObject


The iOS accelerometer (see UIAccelerometer) reports acceleration events as a triplet of vectors. Looking at the face of an iOS device, positive X is to the right, positive Y is to the top, and positive Z is towards the viewer. The value of each vector is a double whose units are g-force.

Application developers should not rely on the accuracy of a single acceleration event but rather should rather average or otherwise interpolate from a series of readings.

The UIEventSubtype.MotionShake event subtype can be used to detect a shake gesture. (See UIEvent.)

Related content


Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions:

The members of MonoTouch.UIKit.UIAcceleration are listed below.

See Also: NSObject

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

ClassHandleIntPtr. The handle for this class.
TimeDouble. The relative time at which the acceleration event occurred. Read-only.
XDouble. The acceleration value along the X axis of the device. Read-only.
YDouble. The acceleration value along the Y axis of the device. Read-only.
ZDouble. The acceleration value along the Z axis of the device. Read-only.