This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let healthStore = HKHealthStore() | |
func applicationShouldRequestHealthAuthorization(_ application: UIApplication) { | |
print("AUTH ME") | |
self.healthStore.handleAuthorizationForExtension(completion: { (success, error) in }) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func onStart() { | |
//vibrate | |
WKInterfaceDevice().play(WKHapticType.start) | |
self.askForHKPermission() | |
} | |
private func askForHKPermission () { | |
let healthStore = HKHealthStore() | |
//data to extract from HK | |
var readTypes = Set<HKObjectType>() |