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(queue: OperationQueue,
                interval: TimeInterval,
                using referenceFrame: CMAttitudeReferenceFrame,
                handler: @escaping (Event) -> Void)

    Parameters

    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.

    interval

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

    referenceFrame

    The reference frame to use for device motion measurements.

    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
  • A Boolean value indicating whether device motion measuring is available on the device.

    Declaration

    Swift

    public var isAvailable: Bool
  • Declaration

    Swift

    public override final func cleanupMonitor()
  • Declaration

    Swift

    public override final func configureMonitor()