The latest sample of magnetometer data.
SDKs
- iOS 5.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
Framework
- Core Motion
Declaration
var magnetometerData: CMMagnetometer Data? { get }
Discussion
If no magnetometer data is available, the value of this property is nil
. An app that is receiving magnetometer data after calling start
periodically checks the value of this property and processes the magnetometer data.