Class

CMPedometer

An object for fetching the system-generated live walking data.

Declaration

@interface CMPedometer : NSObject

Overview

You use a pedometer object to retrieve step counts and other information about the distance traveled and the number of floors ascended or descended. The pedometer object manages a cache of historic data that you can query or you can ask for live updates as the data is processed.

To use a pedometer object, create an instance of this class and call the appropriate methods. Use the queryPedometerDataFromDate:toDate:withHandler: method to retrieve data that has already been gathered. To get live updates, use the startPedometerUpdatesFromDate:withHandler: method to start the delivery of events to the handler you provide.

Topics

Determining Pedometer Availability

+ isStepCountingAvailable

Returns a Boolean value indicating whether step counting is available on the current device.

+ isDistanceAvailable

Returns a Boolean value indicating whether distance estimation is available on the current device.

+ isFloorCountingAvailable

Returns a Boolean value indicating whether floor counting is available on the current device.

+ isPaceAvailable

Returns a Boolean value indicating whether pace information is available on the current device.

+ isCadenceAvailable

Returns a Boolean value indicating whether cadence information is available on the current device.

+ isPedometerEventTrackingAvailable

Returns a Boolean value indicating whether pedometer events are available on the current device.

+ authorizationStatus

Returns a value indicating whether the app is authorized to gather pedometer data.

CMAuthorizationStatus

The authorization status for motion-related features.

Generating Live Pedometer Data

- startPedometerUpdatesFromDate:withHandler:

Starts the delivery of recent pedestrian-related data to your app.

- stopPedometerUpdates

Stops the delivery of recent pedestrian data updates to your app.

- startPedometerEventUpdatesWithHandler:

Starts the delivery of pedometer events to your app.

- stopPedometerEventUpdates

Stops the delivery of pedometer events to your app.

CMPedometerHandler

A block for processing pedometer-related data.

CMPedometerEventHandler

A block for processing pedometer events.

Fetching Historical Pedometer Data

- queryPedometerDataFromDate:toDate:withHandler:

Retrieves the data between the specified start and end dates.

Relationships

Inherits From

See Also

Pedometer

CMPedometerData

Information about the distance traveled by a user on foot.

CMPedometerEvent

A change in the user's pedestrian activity.

CMStepCounter

The number of steps the user has taken with the device.

Deprecated