WIP
This commit is contained in:
@@ -148,10 +148,11 @@ struct AllWorkoutsView: View {
|
||||
HKObjectType.quantityType(forIdentifier: .heartRate)!,
|
||||
HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)!,
|
||||
HKObjectType.quantityType(forIdentifier: .oxygenSaturation)!,
|
||||
HKObjectType.activitySummaryType(),
|
||||
HKQuantityType.workoutType()
|
||||
]
|
||||
|
||||
healthStore.requestAuthorization(toShare: healthKitTypes, read: healthKitTypes) { (succ, error) in
|
||||
healthStore.requestAuthorization(toShare: nil, read: healthKitTypes) { (succ, error) in
|
||||
if !succ {
|
||||
fatalError("Error requesting authorization from health store: \(String(describing: error)))")
|
||||
}
|
||||
|
||||
@@ -81,6 +81,9 @@ struct CompletedWorkoutView: View {
|
||||
gettingHealthKitData = true
|
||||
healthKitHelper.getDetails(forHealthKitUUID: healthKitUUID,
|
||||
completion: { healthKitWorkoutData in
|
||||
guard let healthStore = healthKitWorkoutData else {
|
||||
return
|
||||
}
|
||||
self.healthKitWorkoutData = healthKitWorkoutData
|
||||
gettingHealthKitData = false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user