<!--
{
  "availability" : [
    "iOS: 7.0.0 - 8.0.0",
    "iPadOS: 7.0.0 - 8.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMotion",
  "identifier" : "/documentation/CoreMotion/CMStepCounter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Motion"
    ],
    "preciseIdentifier" : "c:objc(cs)CMStepCounter"
  },
  "title" : "CMStepCounter"
}
-->

# CMStepCounter

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

```
class CMStepCounter
```

## 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`](/documentation/CoreMotion/CMStepCounter/isStepCountingAvailable())

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

### Starting and Stopping Step Counting Updates

[`-  startStepCountingUpdatesToQueue:updateOn:withHandler:`](/documentation/CoreMotion/CMStepCounter/startStepCountingUpdates(to:updateOn:withHandler:))

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

[`-  stopStepCountingUpdates`](/documentation/CoreMotion/CMStepCounter/stopStepCountingUpdates())

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

[`CMStepUpdateHandler`](/documentation/CoreMotion/CMStepUpdateHandler)

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

### Getting Historical Step Counting Data

[`-  queryStepCountStartingFrom:to:toQueue:withHandler:`](/documentation/CoreMotion/CMStepCounter/queryStepCountStarting(from:to:to:withHandler:))

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

[`CMStepQueryHandler`](/documentation/CoreMotion/CMStepQueryHandler)

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

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)