WatchOS 2 Heart Rate Sensor

Does anyone know how to access the heart rate sensor available in watchOS 2 in Xcode 7 beta?

+5
source share
3 answers

watchOS 2 allows you to use HealthKit . In this kit, you can use HKWorkout to access variables such as heart rate.

+7
source

Apple does not technically provide developers with access to heart rate sensors in watchOS 2.0. What they do is direct access to heart rate data recorded by the sensor in HealthKit. See the answer to this question for more details.

+4
source

Many of the iOS software suites are now available for watchOS, such as HealthKit.

You can use the HealthKit (HK) features and classes to calculate calories burned, heart rate, etc.

You can use HKWorkout to calculate everything about your workouts and access related variables, such as heart rate, just like you did with iOS before.

Read the Apple developer documentation to learn about HealthKit. They can be found at developer.apple.com .

Resources

For more information on HKWorkout , you should check out the HKWorkout Class Reference and Apple's HKWorkoutSession Class Reference .

Also be sure to check out this great WWDC15 video.

+3
source

All Articles