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 moreDeclaration
Swift
public enum Event -
Encapsulates the type (or types) of motion for the device.
See moreDeclaration
Swift
public enum Info -
Initializes a new
MotionActivityMonitor.Declaration
Swift
public init(queue: OperationQueue, handler: @escaping (Event) -> Void)Parameters
queueThe operation queue on which the handler executes.
handlerThe 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 { get } -
Retrieves historical motion data for the specified time period.
Declaration
Swift
public func query(from start: Date, to end: Date)Parameters
startThe start time to use when gathering motion data.
endThe end time to use when gathering motion data.
-
Declaration
Swift
override public func cleanupMonitor() -
Declaration
Swift
override public func configureMonitor()
View on GitHub
Install in Dash
MotionActivityMonitor Class Reference