Class

CMMotionActivity

The data for a single motion update event.

Declaration

@interface CMMotionActivity : CMLogItem

Overview

On devices that support motion, you can use a CMMotionActivityManager object to request updates when the current type of motion changes. When a change occurs, the update information is packaged into a CMMotionActivity object and sent to your app.

The motion-related properties of this class are not mutually exclusive. In other words, it is possible for more than one of the motion-related properties to contain the value YES. For example, if the user was driving in a car and the car stopped at a red light, the update event associated with that change in motion would have both the cycling and stationary properties set to YES. It is also possible for all of the properties to be set to NO when the device is in motion but the movement does not correlate to walking, running, cycling or automotive travel.

You do not create instances of this class yourself. The CMMotionActivityManager object creates them and sends them to the handler block you registered. For more information about how to initiate the delivery of motion activity updates to your app, see CMMotionActivityManager.

Topics

Getting the Type of Motion

stationary

A Boolean indicating whether the device is stationary.

walking

A Boolean indicating whether the device is on a walking person.

running

A Boolean indicating whether the device is on a running person.

automotive

A Boolean indicating whether the device is in an automobile.

cycling

A Boolean indicating whether the device is in a bicycle.

unknown

A Boolean indicating whether the type of motion is unknown.

Getting Metadata for the Motion

startDate

The time at which the change in motion occurred.

confidence

The confidence in the assessment of the motion type.

CMMotionActivityConfidence

The confidence that the motion data is accurate.

Relationships

Inherits From

See Also

Historical Data

CMMotionActivityManager

An object that manages access to the motion data stored by the device.