DeviceMotionMonitor

public class DeviceMotionMonitor : BaseMonitor

A DeviceMotionMonitor instance monitors the device’s accelerometer, gyroscope, and magnetometer for periodic raw measurements which are processed into device motion measurements.

  • Encapsulates updates to the measurement of device motion.

    See more

    Declaration

    Swift

    public enum Event
  • Encapsulates the measurement of device motion.

    See more

    Declaration

    Swift

    public enum Info
  • Initializes a new DeviceMotionMonitor.

    Declaration

    Swift

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

    Parameters

    interval

    The interval, in seconds, for providing device motion measurements to the handler.

    referenceFrame

    The reference frame to use for device motion measurements.

    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 device motion measurement is available.

  • The latest device motion measurement available.

    Declaration

    Swift

    public var info: Info { get }
  • A Boolean value indicating whether device motion measuring is available on the device.

    Declaration

    Swift

    public var isAvailable: Bool { get }
  • Declaration

    Swift

    override public func cleanupMonitor()
  • Declaration

    Swift

    override public func configureMonitor()