<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMotion",
  "identifier" : "/documentation/CoreMotion/CMPedometerEventHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Core Motion"
    ],
    "preciseIdentifier" : "c:@T@CMPedometerEventHandler"
  },
  "title" : "CMPedometerEventHandler"
}
-->

# CMPedometerEventHandler

A block for processing pedometer events.

```
typealias CMPedometerEventHandler = (CMPedometerEvent?, (any Error)?) -> Void
```

## Discussion

You provide a block of this type when requesting pedometer events from a [`CMPedometer`](/documentation/CoreMotion/CMPedometer) object. When a new event becomes available, the pedometer object delivers that data to your block for processing. If there was an error retrieving the data, the pedometer object provides an error object instead.

This block has no return value and takes the following parameters.

- `pedometerEvent`: A [`CMPedometerEvent`](/documentation/CoreMotion/CMPedometerEvent) object containing the event information. If there was an error retrieving the data, this parameter is nil.
- `error`: An <doc://com.apple.documentation/documentation/Foundation/NSError> object if there was a problem or `nil` if the pedometer event was retrieved successfully.

---

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)