UIAcceleration

An instance of the UIAcceleration class, called an acceleration event, represents immediate, three-dimensional acceleration data. To receive accelerometer events, register an application object as a delegate of the shared UIAccelerometer object, as described in UIAccelerometer Class Reference.

Each acceleration event includes simultaneous acceleration readings along the three axes of the device, as shown in Figure 1.

Figure 1Orientation of the device axes

The device accelerometer reports values for each axis in units of g-force, where a value of 1.0 represents acceleration of about +1 g along a given axis. When a device is laying still with its back on a horizontal surface, each acceleration event has approximately the following values:

x:0

y:0

z:-1

Individual acceleration values are of type UIAccelerationValue, equivalent to a double. Values can range over the accelerations found in normal use of a device.

Note

Acceleration event values are approximate—don’t attempt to use them to make precise measurements. Apple recommends that you average accelerometer values over time to derive usable data.

Declaration

Discussion

This value indicates the time relative to the device CPU time base register. Compare acceleration event timestamps to determine the elapsed time between them. Do not use a timestamp to determine the exact time at which an event occurred.