<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMotion",
  "identifier" : "/documentation/CoreMotion/CMAltitudeHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Core Motion"
    ],
    "preciseIdentifier" : "c:@T@CMAltitudeHandler"
  },
  "title" : "CMAltitudeHandler"
}
-->

# CMAltitudeHandler

A block for receiving relative altitude data.

```
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

You pass a block of this type to the altimeter object’s [`startRelativeAltitudeUpdates(to:withHandler:)`](/documentation/CoreMotion/CMAltimeter/startRelativeAltitudeUpdates(to:withHandler:)) method when starting the delivery of altitude data.

---

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)