<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreLocation",
  "identifier" : "/documentation/CoreLocation/CLHeading/magneticHeading",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Location"
    ],
    "preciseIdentifier" : "c:objc(cs)CLHeading(py)magneticHeading"
  },
  "title" : "magneticHeading"
}
-->

# magneticHeading

The heading (measured in degrees) relative to magnetic north.

```
var magneticHeading: CLLocationDirection { get }
```

## Discussion

The value in this property represents the heading relative to the magnetic North Pole, which is different from the geographic North Pole. The value `0` means the device is pointed toward magnetic north, `90` means it is pointed east, `180` means it is pointed south, and so on. The value in this property should always be valid.

In iOS 3.x and earlier, the value in this property is always measured relative to the top of the device in a portrait orientation, regardless of the device’s actual physical or interface orientation. In iOS 4.0 and later, the value is measured relative to the heading orientation specified by the location manager. For more information, see the [`headingOrientation`](/documentation/CoreLocation/CLLocationManager/headingOrientation) property in [`CLLocationManager`](/documentation/CoreLocation/CLLocationManager).

If the [`headingAccuracy`](/documentation/CoreLocation/CLHeading/headingAccuracy) property contains a negative value, the value in this property should be considered unreliable.

---

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)