Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SimformSolutionsPvtLtd/CMPedometerDemo
Let's count steps using CMPedometer
https://github.com/SimformSolutionsPvtLtd/CMPedometerDemo
coremotion ios pedometer watchkit watchos
Last synced: 3 months ago
JSON representation
Let's count steps using CMPedometer
- Host: GitHub
- URL: https://github.com/SimformSolutionsPvtLtd/CMPedometerDemo
- Owner: SimformSolutionsPvtLtd
- License: mit
- Created: 2018-03-14T14:42:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T13:39:55.000Z (almost 7 years ago)
- Last Synced: 2024-07-23T22:03:33.009Z (6 months ago)
- Topics: coremotion, ios, pedometer, watchkit, watchos
- Language: Swift
- Size: 16.6 KB
- Stars: 14
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-SS-Mobile - CMPedometerDemo - Let's count steps using CMPedometer. (iOS Guides / Swift)
README
# CMPedometerDemo
Let's count steps using CMPedometer# Usage
#### Live steps
```swift
activityHelper.stepsCountingHandler = { steps,
distance,
averagePace,
pace,
floorsAscended,
floorsDscended,
cadence,
timeElapsed in
}
```
Then start observing using:
```swift
activityHelper.startMonitoring()
```
To Stop observing Steps:
```swift
activityHelper.stopMonitoring()
```
#### Historical steps
```swift
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
})
```