PedometerMonitor

public class PedometerMonitor : BaseMonitor

A PedometerMonitor instance monitors the device for live and historic walking data. You can retrieve step counts and other information about the distance traveled and the number of floors ascended or descended.

  • Encapsulates updates to and queries about the walking data.

    See more

    Declaration

    Swift

    public enum Event
  • Encapsulates information about the distance traveled by the user on foot.

    See more

    Declaration

    Swift

    public enum Info
  • Initializes a new PedometerMonitor.

    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 walking data is available or when a query for historical walking data completes.

  • A Boolean value indicating whether cadence information is available on the device.

    Declaration

    Swift

    public var isCadenceAvailable: Bool { get }
  • A Boolean value indicating whether distance estimation is available on the device.

    Declaration

    Swift

    public var isDistanceAvailable: Bool { get }
  • A Boolean value indicating whether floor counting is available on the device.

    Declaration

    Swift

    public var isFloorCountingAvailable: Bool { get }
  • A Boolean value indicating whether pace information is available on the device.

    Declaration

    Swift

    public var isPaceAvailable: Bool { get }
  • A Boolean value indicating whether step counting is available on the device.

    Declaration

    Swift

    public var isStepCountingAvailable: Bool { get }
  • Retrieves the historical walking 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 walking data.

    end

    The end time to use when gathering walking data.

  • Declaration

    Swift

    override public func cleanupMonitor()
  • Declaration

    Swift

    override public func configureMonitor()