<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMotion",
  "identifier" : "/documentation/CoreMotion/CMAltimeter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Motion"
    ],
    "preciseIdentifier" : "c:objc(cs)CMAltimeter"
  },
  "title" : "CMAltimeter"
}
-->

# CMAltimeter

An object that initiates the delivery of altitude-related changes.

```
class CMAltimeter
```

## Overview

Altitude events report changes in both the relative and absolute altitude. For example, a hiking app could use this object to track the user’s elevation change over the course of a hike, or to report their current absolute altitude during the hike.

Because altitude events may not be available on all devices, always call the [`isRelativeAltitudeAvailable()`](/documentation/CoreMotion/CMAltimeter/isRelativeAltitudeAvailable()) method before starting relative altitude updates, and call [`isAbsoluteAltitudeAvailable()`](/documentation/CoreMotion/CMAltimeter/isAbsoluteAltitudeAvailable()) before starting absolute altitude updates.

After checking the availability of altitude data, call the [`startRelativeAltitudeUpdates(to:withHandler:)`](/documentation/CoreMotion/CMAltimeter/startRelativeAltitudeUpdates(to:withHandler:)) method to start receiving relative altitude data, or call the [`startAbsoluteAltitudeUpdates(to:withHandler:)`](/documentation/CoreMotion/CMAltimeter/startAbsoluteAltitudeUpdates(to:withHandler:)) method for absolute altitude data.

Core Motion generates events at regular intervals (regardless of whether the data has changed) and delivers them to the block you specified. When you no longer need the event data, call the [`stopRelativeAltitudeUpdates()`](/documentation/CoreMotion/CMAltimeter/stopRelativeAltitudeUpdates()) or [`stopAbsoluteAltitudeUpdates()`](/documentation/CoreMotion/CMAltimeter/stopAbsoluteAltitudeUpdates()) methods respectively.

> Important:
> To use this API, you must include the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSMotionUsageDescription> key in your app’s `Info.plist` file and provide a usage description string for this key. The usage description appears in the prompt that the user must accept the first time the system asks the user to access motion data for your app. If you don’t include a usage description string, your app crashes when you call this API.

## Topics

### Determining Altitude Availability

[`+  isAbsoluteAltitudeAvailable`](/documentation/CoreMotion/CMAltimeter/isAbsoluteAltitudeAvailable())

Returns a Boolean value indicating whether the current device reports changes in the absolute altitude.

[`+  isRelativeAltitudeAvailable`](/documentation/CoreMotion/CMAltimeter/isRelativeAltitudeAvailable())

Returns a Boolean value indicating whether the current device supports generating data for relative altitude changes.

[`+  authorizationStatus`](/documentation/CoreMotion/CMAltimeter/authorizationStatus())

Returns a value indicating whether the app is authorized to retrieve altimeter data.

[`CMAuthorizationStatus`](/documentation/CoreMotion/CMAuthorizationStatus)

The authorization status for motion-related features.

### Starting and Stopping Altitude Updates

[`-  startAbsoluteAltitudeUpdatesToQueue:withHandler:`](/documentation/CoreMotion/CMAltimeter/startAbsoluteAltitudeUpdates(to:withHandler:))

Starts the delivery of absolute altitude data to the specified handler.

[`-  stopAbsoluteAltitudeUpdates`](/documentation/CoreMotion/CMAltimeter/stopAbsoluteAltitudeUpdates())

Stops the delivery of absolute altitude data for this altimeter object.

[`CMAbsoluteAltitudeHandler`](/documentation/CoreMotion/CMAbsoluteAltitudeHandler)

A block for receiving absolute altitude data.

[`-  startRelativeAltitudeUpdatesToQueue:withHandler:`](/documentation/CoreMotion/CMAltimeter/startRelativeAltitudeUpdates(to:withHandler:))

Starts the delivery of relative altitude data to the specified handler.

[`-  stopRelativeAltitudeUpdates`](/documentation/CoreMotion/CMAltimeter/stopRelativeAltitudeUpdates())

Stops the delivery of relative altitude data for the altimeter object.

[`CMAltitudeHandler`](/documentation/CoreMotion/CMAltitudeHandler)

A block for receiving relative altitude data.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)