Class

CMStepCounter

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

Declaration

@interface CMStepCounter : NSObject

Overview

Step information is gathered on devices with the appropriate built-in hardware and stored so that you can run queries to determine the user’s recent physical activity. You use this class to gather both current step data and any historical data.

Topics

Determining Step Counting Availability

+ isStepCountingAvailable

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

Starting and Stopping Step Counting Updates

- startStepCountingUpdatesToQueue:updateOn:withHandler:

Starts the delivery of current step-counting data to your app.

- stopStepCountingUpdates

Stops the delivery of step-counting updates to your app.

CMStepUpdateHandler

A block that reports the number of steps recorded since updates began.

Getting Historical Step Counting Data

- queryStepCountStartingFrom:to:toQueue:withHandler:

Gathers and returns historical step count data for the specified time period.

CMStepQueryHandler

A block that reports the number of steps for a query operation.

Relationships

Inherits From

See Also

Pedometer

CMPedometer

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

CMPedometerData

Information about the distance traveled by a user on foot.

CMPedometerEvent

A change in the user's pedestrian activity.