<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMotion",
  "identifier" : "/documentation/CoreMotion/CMAttitudeReferenceFrame",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Motion"
    ],
    "preciseIdentifier" : "c:@E@CMAttitudeReferenceFrame"
  },
  "title" : "CMAttitudeReferenceFrame"
}
-->

# CMAttitudeReferenceFrame

Constants that indicate the frame of reference for attitude-related motion data.

```
struct CMAttitudeReferenceFrame
```

## Overview

When you start a service that reports the device’s attitude in three-dimensional space, Core Motion establishes a frame of reference for reporting pitch, roll, and yaw values. All subsequent data values specify the device attitude relative to this frame of reference. To get a list of the currently available reference frames for the current device, call the [`availableAttitudeReferenceFrames()`](/documentation/CoreMotion/CMMotionManager/availableAttitudeReferenceFrames()) class method.

When starting services, it’s your responsibility to specify a reference frame that’s available on the current device. Services that don’t let you specify a reference frame explicitly rely on the value in the [`attitudeReferenceFrame`](/documentation/CoreMotion/CMMotionManager/attitudeReferenceFrame) property of [`CMMotionManager`](/documentation/CoreMotion/CMMotionManager).

## Topics

### Getting the reference frames

[`xArbitraryZVertical`](/documentation/CoreMotion/CMAttitudeReferenceFrame/xArbitraryZVertical)

A reference frame where the Z axis is vertical and the X axis points in an arbitrary direction in the horizontal plane.

[`xArbitraryCorrectedZVertical`](/documentation/CoreMotion/CMAttitudeReferenceFrame/xArbitraryCorrectedZVertical)

A reference frame where the Z axis is vertical and has improved rotation accuracy, and the X axis points in an arbitrary direction in the horizontal plane.

[`xMagneticNorthZVertical`](/documentation/CoreMotion/CMAttitudeReferenceFrame/xMagneticNorthZVertical)

A reference frame where the Z axis is vertical and the X axis points to the magnetic north pole.

[`xTrueNorthZVertical`](/documentation/CoreMotion/CMAttitudeReferenceFrame/xTrueNorthZVertical)

A reference frame where the Z axis is vertical and the X axis points to the geographic north pole.

### Initializers

[`init(rawValue:)`](/documentation/CoreMotion/CMAttitudeReferenceFrame/init(rawValue:))



---

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)