<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMotion",
  "identifier" : "/documentation/CoreMotion/CMMotionActivityManager/startActivityUpdates(to:withHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Motion"
    ],
    "preciseIdentifier" : "c:objc(cs)CMMotionActivityManager(im)startActivityUpdatesToQueue:withHandler:"
  },
  "title" : "startActivityUpdates(to:withHandler:)"
}
-->

# startActivityUpdates(to:withHandler:)

Starts the delivery of current motion data updates to your app.

```
func startActivityUpdates(to queue: OperationQueue, withHandler handler: @escaping CMMotionActivityHandler)
```

## Parameters

`queue`

The operation queue on which to execute the specified `handler` block. You can specify a custom queue or use the operation queue associated with your app’s main thread. This parameter must not be `nil`.

`handler`

The block to execute when a change in the current type of motion is detected. For information about the parameters of this block, see [`CMMotionActivityHandler`](/documentation/CoreMotion/CMMotionActivityHandler). This property must not be `nil`.

## Discussion

This method initiates the tracking of motion data asynchronously. Upon calling this method, the motion activity manager executes the `handler` block on the specified `queue`, reporting the current motion in effect for the device. After that, the motion activity manager executes the `handler` block only when the motion data changes.

The `handler` block is executed on a best effort basis and updates are not delivered while your app is suspended. If updates arrived while your app was suspended, the last update is delivered to your app when it resumes execution. To get all of the updates that occurred while your app was suspended, use the [`queryActivityStarting(from:to:to:withHandler:)`](/documentation/CoreMotion/CMMotionActivityManager/queryActivityStarting(from:to:to:withHandler:)) method.

Upon starting activity updates, the motion activity manager reports changes to its block until you call the [`stopActivityUpdates()`](/documentation/CoreMotion/CMMotionActivityManager/stopActivityUpdates()) method. If you call this method again with a new block, the activity manager stops delivering updates to the old block and delivers them to the new block instead. Updates stop altogether when the motion activity manager object itself is deallocated.

---

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)