Add the following entry to your Cartfile:
preparing 🙏
Add the following entry to your Podfile:
preparing 🙏
Then run pod install
To integrate using Apple's Swift package manager, add the following as a dependency to your Package.swift
:
https://github.com/MaeumGajim/MindGymKit.git
-
How to allow camera access:
// Message explaining why the app requested permission to read samples from the HealthKit store. Privacy - Health Share Usage Description ⚓️
-
How to allow album access:
// Message explaining why the app requested permission to save samples to the HealthKit store. Privacy - Health Update Usage Description 🦾
⚠️ Don't forget to fill in the value ⚠️
-
Get today's number of steps:
let mindGym = MindGymKit() mindGym.fetchTodayStepCount { stepCount in DispatchQueue.main.async { if let stepCount = stepCount { print("todayStep: \(stepCount)") } else { print("Error") } } }
-
Using a stopwatch:
let stopwatch = MindGymStopWatchKit() stopwatch.mainStopwatch.timeUpdate .observe(on: MainScheduler.instance) .subscribe(onNext: { [weak self] timeString in self?.stopWatchLabel.text = timeString }) .disposed(by: disposeBag) stopwatch.mainStopwatch.recordUpdate .observe(on: MainScheduler.instance) .subscribe(onNext: { [weak self] lapTimes in self?.lapRecords = lapTimes self?.lapRecords.append(lapTimes.last ?? "") print("Lap record : \(String(describing: self?.lapRecords ?? nil))") }) .disposed(by: disposeBag)