---
title: CMAltitudeHandler
framework: coremotion
role: symbol
role_heading: Type Alias
path: coremotion/cmaltitudehandler
---

# CMAltitudeHandler

A block for receiving relative altitude data.

## Declaration

```swift
typealias CMAltitudeHandler = (CMAltitudeData?, (any Error)?) -> Void
```

## Parameters

- `altitudeData`: The relative change in altitude data. If there’s an error generating the data, this parameter is nil.
- `error`: The error object. Returns nil if the altimeter successfully delivers the altitude data. When an error occurs, you can use the information in the provided object to recover the data or to alert the user.

## Discussion

Discussion You pass a block of this type to the altimeter object’s startRelativeAltitudeUpdates(to:withHandler:) method when starting the delivery of altitude data.

## See Also

### Starting and Stopping Altitude Updates

- [startAbsoluteAltitudeUpdates(to:withHandler:)](coremotion/cmaltimeter/startabsolutealtitudeupdates(to:withhandler:).md)
- [stopAbsoluteAltitudeUpdates()](coremotion/cmaltimeter/stopabsolutealtitudeupdates().md)
- [CMAbsoluteAltitudeHandler](coremotion/cmabsolutealtitudehandler.md)
- [startRelativeAltitudeUpdates(to:withHandler:)](coremotion/cmaltimeter/startrelativealtitudeupdates(to:withhandler:).md)
- [stopRelativeAltitudeUpdates()](coremotion/cmaltimeter/stoprelativealtitudeupdates().md)
