Instance Method

startAccelerometerUpdatesToQueue:withHandler:

Starts accelerometer updates on an operation queue and with a specified handler.

Declaration

- (void)startAccelerometerUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMAccelerometerHandler)handler;

Parameters

queue

An operation queue provided by the caller. Because the processed events might arrive at a high rate, using the main operation queue is not recommended.

handler

A block that is invoked with each update to handle new accelerometer data. The block must conform to the CMAccelerometerHandler type.

Discussion

You must call stopAccelerometerUpdates when you no longer want your app to process accelerometer updates.

See Also

Managing Accelerometer Updates

accelerometerUpdateInterval

The interval, in seconds, for providing accelerometer updates to the block handler.

- startAccelerometerUpdates

Starts accelerometer updates without a handler.

- stopAccelerometerUpdates

Stops accelerometer updates.

accelerometerData

The latest sample of accelerometer data.

CMAccelerometerHandler

The type of block callback for handling accelerometer data.