MagnetometerMonitor

public class MagnetometerMonitor: BaseMonitor

A MagnetometerMonitor instance monitors the device’s magnetometer for periodic raw measurements of the magnetic field around the three spatial axes.

  • Encapsulates updates to the measurement of the magnetic field around the three spatial axes.

    See more

    Declaration

    Swift

    public enum Event
  • Encapsulates the measurement of the magnetic field around the three spatial axes.

    See more

    Declaration

    Swift

    public enum Info
  • Initializes a new MagnetometerMonitor.

    Declaration

    Swift

    public init(interval: TimeInterval,
                queue: OperationQueue,
                handler: @escaping (Event) -> Void)

    Parameters

    interval

    The interval, in seconds, for providing magnetic field measurements to the handler.

    queue

    The operation queue on which the handler executes. Because the events might arrive at a high rate, using the main operation queue is not recommended.

    handler

    The handler to call periodically when a new magnetic field measurement is available.

  • The latest magnetic field measurement available.

    Declaration

    Swift

    public var info: Info
  • A Boolean value indicating whether a magnetometer is available on the device.

    Declaration

    Swift

    public var isAvailable: Bool
  • Declaration

    Swift

    override public func cleanupMonitor()
  • Declaration

    Swift

    override public func configureMonitor()