Working Out with HealthKit
The sensors we looked at accessing in the previous part of this chapter, such as the accelerometer, are great at providing data about the device, but the Apple Watch has another sensor available to us that’s only available on the watch: the heart rate sensor on the back of the device. This sensor, combined with the impressive water resistance of the watch, makes it an amazing companion for working out, whether you’re a weekend warrior or professional athlete. Let’s add support for this sensor to TapALap. You’ll use the watch to save a workout session to HealthKit, which will allow you not only to access heart rate and calorie burn data but also to save the data back to the user’s phone and contribute to his daily Activity ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access