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

# CMMotionActivityQueryHandler

A block that reports the motion updates that occurred between the specified query interval.

```
typealias CMMotionActivityQueryHandler = ([CMMotionActivity]?, (any Error)?) -> Void
```

## Discussion

This block takes the following parameters:

- `activities`: An array of [`CMMotionActivity`](/documentation/CoreMotion/CMMotionActivity) objects indicating the updates that occurred. The objects in the array are ordered by the time at which they occurred in the specified time interval. Use the [`startDate`](/documentation/CoreMotion/CMMotionActivity/startDate) property in each motion object to determine when the update occurred.
- `error`: An error object indicating that there was a problem gathering the data or `nil` if the motion data 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)