O'Reilly logo

Application Development with Swift by Hossam Ghareeb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting started with HealthKit

To get started with HealthKit, we will create a demo that will teach you how to request permission from the user to access his data from the Health app, read and format this information to make it readable for the user, and write info in the Health app. Now, go to Xcode and create a new project with a single view template, and make sure that Swift is selected as the project language.

Configuring the Xcode project

To configure our project using HealthKit, you have to first enable the HealthKit capabilities. To do this, select your target on Xcode, and click on the Capabilities tab. Then, enable HealthKit in the list by switching it ON; check the following screenshot:

After enabling the HealthKit capabilities, HealthKit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required