func setUpHealthRequest(healthStore: HKHealthStore, readSteps: @escaping () -> Void) {
if HKHealthStore.isHealthDataAvailable(), let stepCount = HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount), let dateOfBirth = HKObjectType.characteristicType(forIdentifier: .dateOfBirth), let biologicalSex = HKObjectType.characteristicType(forIdentifier: .biologicalSex){
healthStore.requestAuthorization(toShare: [stepCount], read: ([stepCount], dateOfBirth, biologicalSex)) { success, error in
if success {
readSteps()
} else if error != nil {
print(error ?? "Error")
}
}
}
}