Class

CLHeading

The azimuth (orientation) of the user's device, relative to true or magnetic north.

Overview

A CLHeading object contains computed values for the device's azimuth (orientation) relative to true or magnetic north. It also includes the raw data for the three-dimensional vector used to compute those values. A navigation app might use the information to rotate a map so that it reflects the direction that the user is facing.

Typically, you do not create instances of this class yourself, nor do you subclass it. Instead, you receive instances of this class through the delegate assigned to the CLLocationManager object whose startUpdatingHeading() method you called.

Topics

Accessing the Heading Attributes

var magneticHeading: CLLocationDirection

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

var trueHeading: CLLocationDirection

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

var headingAccuracy: CLLocationDirection

The maximum deviation (measured in degrees) between the reported heading and the true geomagnetic heading.

var timestamp: Date

The time at which this heading was determined.

Accessing the Raw Heading Data

var x: CLHeadingComponentValue

The geomagnetic data (measured in microteslas) for the x-axis.

var y: CLHeadingComponentValue

The geomagnetic data (measured in microteslas) for the y-axis.

var z: CLHeadingComponentValue

The geomagnetic data (measured in microteslas) for the z-axis.

Constants

typealias CLHeadingComponentValue

A type used to report magnetic differences reported by the onboard hardware.

Relationships

Inherits From

See Also

Compass Headings

Getting Heading and Course Information

Use a device's orientation and course information for navigation.