iOS Reference Library Apple Developer
Search

UIAccelerometerDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 2.0 and later.
Declared in
UIAccelerometer.h

Overview

The UIAccelerometerDelegate protocol defines a single method for receiving acceleration-related data from the system. Implementation of this method is optional, but expected.

Tasks

Responding to Acceleration Events

Instance Methods

accelerometer:didAccelerate:

Delivers the latest acceleration data to the delegate.

- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration

Parameters
accelerometer

The application-wide accelerometer object.

acceleration

The most recent acceleration data.

Discussion

The shared UIAccelerometer object invokes this method at the desired interval, providing your delegate with updated acceleration data each time.

This method is always invoked on your application’s main thread when it is in the NSDefaultRunLoopMode run loop mode.

Availability
  • Available in iOS 2.0 and later.
Declared In
UIAccelerometer.h



Last updated: 2008-05-27

Did this document help you? Yes It's good, but... Not helpful...