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

# startDeviceMotionUpdates(using:to:withHandler:)

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

## Declaration

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

## Parameters

- `referenceFrame`: A constant identifying the reference frame to use for device-motion updates. It’s your responsibility to specify a reference frame that’s available on the current device. Call doc://com.apple.coremotion/documentation/CoreMotion/CMMotionManager/availableAttitudeReferenceFrames() to determine which reference frames are currently available.
- `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 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(to:withHandler:)](coremotion/cmmotionmanager/startdevicemotionupdates(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)
