Skip to content

Instantly share code, notes, and snippets.

@nderkach
Last active September 14, 2018 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nderkach/6b13acc236159254156bbfa7c2ccaa6e to your computer and use it in GitHub Desktop.
Save nderkach/6b13acc236159254156bbfa7c2ccaa6e to your computer and use it in GitHub Desktop.
Authorize HealthKit
let healthKitManager = HealthKitManager()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
healthKitManager.requestAccessWithCompletion() { success, error in
if success{ print("HealthKit access granted") }
else { print("Error requesting access to HealthKit: \(error!)") }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment