The type of block callback for handling magnetometer data.
- iOS 5.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
- Core Motion
Blocks of type
CMMagnetometer are called when there is magnetometer data to process. You pass the block into the
start method as the second argument. Blocks of this type return no value but take two arguments:
An object that encapsulates a
CMMagneticstructure with fields holding magnetic-field values for the three axes of movement.
An error object representing an error encountered in providing magnetometer data. If an error occurs, you should stop magnetometer updates and inform the user of the problem. If there is no error, this argument is
nil. Core Motion errors are of the
CMErrordomain and the