---
title: "startDeviceMotionUpdates(to:withHandler:)"
framework: coremotion
role: symbol
role_heading: Instance Method
path: "coremotion/cmmotionmanager/startdevicemotionupdates(to:withhandler:)"
---

# startDeviceMotionUpdates(to:withHandler:)

Starts device-motion updates on an operation queue and using a specified block handler.

## Declaration

```swift
func startDeviceMotionUpdates(to queue: OperationQueue, withHandler handler: @escaping CMDeviceMotionHandler)
```

## Parameters

- `queue`: An operation queue provided by the caller. Because the processed events might arrive at a high rate, using the main operation queue is not recommended.
- `handler`: A block that is invoked with each update to handle new device-motion data. The block must conform to the doc://com.apple.coremotion/documentation/CoreMotion/CMDeviceMotionHandler type.

## Discussion

Discussion This method reports motion relative to the reference frame in the attitudeReferenceFrame property. You must call stopDeviceMotionUpdates() when you no longer want your app to process device-motion updates.

## See Also

### Managing Device Motion Updates

- [showsDeviceMovementDisplay](coremotion/cmmotionmanager/showsdevicemovementdisplay.md)
- [deviceMotionUpdateInterval](coremotion/cmmotionmanager/devicemotionupdateinterval.md)
- [startDeviceMotionUpdates(using:to:withHandler:)](coremotion/cmmotionmanager/startdevicemotionupdates(using:to:withhandler:).md)
- [startDeviceMotionUpdates(using:)](coremotion/cmmotionmanager/startdevicemotionupdates(using:).md)
- [startDeviceMotionUpdates()](coremotion/cmmotionmanager/startdevicemotionupdates().md)
- [stopDeviceMotionUpdates()](coremotion/cmmotionmanager/stopdevicemotionupdates().md)
- [deviceMotion](coremotion/cmmotionmanager/devicemotion.md)
- [CMDeviceMotionHandler](coremotion/cmdevicemotionhandler.md)
