MotionActivityMonitor

public class MotionActivityMonitor: BaseMonitor

A MotionActivityMonitor instance monitors the device for live and historic motion data. Motion data reflects whether the user is walking, running, in a vehicle, or stationary for periods of time.

  • Encapsulates updates to and queries about the motion data.

    See more

    Declaration

    Swift

    public enum Event
  • Encapsulates the type (or types) of motion for the device.

    See more

    Declaration

    Swift

    public enum Info
  • Initializes a new MotionActivityMonitor.

    Declaration

    Swift

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

    Parameters

    queue

    The operation queue on which the handler executes.

    handler

    The handler to call when new motion data is available or when a query for historical motion data completes.

  • A Boolean value indicating whether motion data is available on the device.

    Declaration

    Swift

    public var isAvailable: Bool
  • Retrieves historical motion data for the specified time period.

    Declaration

    Swift

    public func query(from start: Date,
                      to end: Date)

    Parameters

    start

    The start time to use when gathering motion data.

    end

    The end time to use when gathering motion data.

  • Declaration

    Swift

    override public func cleanupMonitor()
  • Declaration

    Swift

    override public func configureMonitor()