---
title: CMDeviceMotionHandler
framework: coremotion
role: symbol
role_heading: Type Alias
path: coremotion/cmdevicemotionhandler
---

# CMDeviceMotionHandler

The type of block callback for handling device-motion data.

## Declaration

```swift
typealias CMDeviceMotionHandler = (CMDeviceMotion?, (any Error)?) -> Void
```

## Mentioned in

Getting processed device-motion data

## Discussion

Discussion Blocks of type CMDeviceMotionHandler are called when there is device-motion data to process. You pass the block into startDeviceMotionUpdates(to:withHandler:) as the second argument. Blocks of this type return no value but take two arguments:

## 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(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)
