<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMotion",
  "identifier" : "/documentation/CoreMotion/CMStepUpdateHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Core Motion"
    ],
    "preciseIdentifier" : "c:@T@CMStepUpdateHandler"
  },
  "title" : "CMStepUpdateHandler"
}
-->

# CMStepUpdateHandler

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

```
typealias CMStepUpdateHandler = (Int, Date, (any Error)?) -> Void
```

## Discussion

This block takes the following parameters:

- `numberOfSteps`: The total number of steps since the [`startStepCountingUpdates(to:updateOn:withHandler:)`](/documentation/CoreMotion/CMStepCounter/startStepCountingUpdates(to:updateOn:withHandler:)) method was called.
- `timestamp`: The time at which the current step count was reported.
- `error`: An error object indicating that there was a problem gathering the data or `nil` if the number of steps was determined correctly.

---

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)