Type Alias

CMPedometerEventHandler

A block for processing pedometer events.

Declaration

typealias CMPedometerEventHandler = (CMPedometerEvent?, Error?) -> Void

Discussion

You provide a block of this type when requesting pedometer events from a CMPedometer object. When a new event becomes available, the pedometer object delivers that data to your block for processing. If there was an error retrieving the data, the pedometer object provides an error object instead.

This block has no return value and takes the following parameters.

pedometerEvent

A CMPedometerEvent object containing the event information. If there was an error retrieving the data, this parameter is nil.

error

An NSError object if there was a problem or nil if the pedometer event was retrieved successfully.

See Also

Generating Live Pedometer Data

func startUpdates(from: Date, withHandler: CMPedometerHandler)

Starts the delivery of recent pedestrian-related data to your app.

func stopUpdates()

Stops the delivery of recent pedestrian data updates to your app.

func startEventUpdates(handler: CMPedometerEventHandler)

Starts the delivery of pedometer events to your app.

func stopEventUpdates()

Stops the delivery of pedometer events to your app.

typealias CMPedometerHandler

A block for processing pedometer-related data.