Awesome
CMPedometerDemo
Let's count steps using CMPedometer
Usage
Live steps
activityHelper.stepsCountingHandler = { steps,
distance,
averagePace,
pace,
floorsAscended,
floorsDscended,
cadence,
timeElapsed in
}
Then start observing using:
activityHelper.startMonitoring()
To Stop observing Steps:
activityHelper.stopMonitoring()
Historical steps
let startDate = Date() // Your desire start date
let endDate = Date() // Your desire end date
activityHelper.getStepsDataFor(startDate: startDate,
endDate: endDate,
successBlock: {(steps,
distance,
averagePace,
pace,
floorsAscended,
floorsDscended,
cadence,
timeElapsed ) in
}, errorBlock: { (error) in
})