I\'m adding code for healthkit in my ios Swift app, but I\'m getting an error...
/* Ask for permission to access the health store */
override func viewDidAppear
That error is due to the fact that you have not added the HealthKit Entitlement to your target.
1) Go to your project settings in Xcode. 2) From there, navigate to the "Capabilities" Tab. 3) Scroll down until you see "HealthKit" and flip the switch to on. 4) Xcode will now add the HealthKit Entitlement to you Info.plist, your {ProjectName}.entitlements file, and your App ID on iTunes Connect
After following these steps, try to run your app again. This time around it should work.