Skip to content

Instantly share code, notes, and snippets.

@leogdion
Last active June 11, 2018 16:19
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 leogdion/25d0734330f2aa7dd9087020947aa26e to your computer and use it in GitHub Desktop.
Save leogdion/25d0734330f2aa7dd9087020947aa26e to your computer and use it in GitHub Desktop.
Handle AppleWatch Request For Authorization on iPhone
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate
{
...
func applicationShouldRequestHealthAuthorization(_ application: UIApplication) {
let healthStore = HKHealthStore()
healthStore.handleAuthorizationForExtension {
(success, error) -> Void in
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment