iOS Developer Library

Developer

UIKit Framework Reference UIAcceleration Class Reference

Options
Deployment Target:

On This Page
Language:

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. More...

Inheritance


Conforms To


Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 2.0 and later.
Deprecated in iOS 5.0.
  • x x (iOS 5.0) Property

    The acceleration value for the x axis of the device. (read-only)

    Declaration

    Objective-C

    @property(nonatomic, readonly) UIAccelerationValue x

    Discussion

    With the device held in portrait orientation and the screen facing you, the x axis runs from left (negative values) to right (positive values) across the face of the device.

    Import Statement

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 5.0.

  • y y (iOS 5.0) Property

    The acceleration value for the y axis of the device. (read-only)

    Declaration

    Objective-C

    @property(nonatomic, readonly) UIAccelerationValue y

    Discussion

    With the device held in portrait orientation and the screen facing you, the y axis runs from bottom (negative values) to top (positive values) across the face of the device.

    Import Statement

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 5.0.

  • z z (iOS 5.0) Property

    The acceleration value for the z axis of the device. (read-only)

    Declaration

    Objective-C

    @property(nonatomic, readonly) UIAccelerationValue z

    Discussion

    With the device held in portrait orientation and the screen facing you, the z axis runs from back (negative values) to front (positive values) through the device.

    Import Statement

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 5.0.

  • timestamp timestamp (iOS 5.0) Property

    The relative time at which the acceleration event occurred. (read-only)

    Declaration

    Objective-C

    @property(nonatomic, readonly) NSTimeInterval timestamp

    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.

    Import Statement

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 5.0.

Data Types

  • The amount of acceleration in a single linear direction.

    Declaration

    Swift

    typealias UIAccelerationValue = Double

    Objective-C

    typedef double UIAccelerationValue;

    Discussion

    This type is used to store acceleration values, which are specified as g-force values, where the value 1.0 corresponds to the normal acceleration caused by gravity at the Earth’s surface.

    Import Statement

    import UIKit

    Availability

    Available in iOS 2.0 and later.