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 moreDeclaration
Swift
public enum Event -
Encapsulates the measurement of the magnetic field around the three spatial axes.
See moreDeclaration
Swift
public enum Info -
Initializes a new
MagnetometerMonitor.Declaration
Swift
public init(interval: TimeInterval, queue: OperationQueue, handler: @escaping (Event) -> Void)Parameters
intervalThe interval, in seconds, for providing magnetic field measurements to the handler.
queueThe operation queue on which the handler executes. Because the events might arrive at a high rate, using the main operation queue is not recommended.
handlerThe handler to call periodically when a new magnetic field measurement is available.
-
The latest magnetic field measurement available.
Declaration
Swift
public var info: Info { get } -
A Boolean value indicating whether a magnetometer is available on the device.
Declaration
Swift
public var isAvailable: Bool { get } -
Declaration
Swift
override public func cleanupMonitor() -
Declaration
Swift
override public func configureMonitor()
View on GitHub
Install in Dash
MagnetometerMonitor Class Reference