Instance Method

startDeviceMotionUpdatesToQueue:withHandler:

Starts device-motion updates on an operation queue and using a specified block handler.

Declaration

- (void)startDeviceMotionUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMDeviceMotionHandler)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 device-motion data. The block must conform to the CMDeviceMotionHandler type.

Discussion

This method uses the reference frame returned by attitudeReferenceFrame for device-motion updates. You must call stopDeviceMotionUpdates when you no longer want your app to process device-motion updates.

See Also

Managing Device Motion Updates

showsDeviceMovementDisplay

Controls whether the device-movement display is shown.

deviceMotionUpdateInterval

The interval, in seconds, for providing device-motion updates to the block handler.

- startDeviceMotionUpdatesUsingReferenceFrame:toQueue:withHandler:

Starts device-motion updates on an operation queue and using a specified reference frame and block handler.

- startDeviceMotionUpdatesUsingReferenceFrame:

Starts device-motion updates using a reference frame but without a block handler.

- startDeviceMotionUpdates

Starts device-motion updates without a block handler.

- stopDeviceMotionUpdates

Stops device-motion updates.

deviceMotion

The latest sample of device-motion data.

CMDeviceMotionHandler

The type of block callback for handling device-motion data.