Antonis
Antonis

Reputation: 81

watchOS 2 Heart Rate Sensor

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

Upvotes: 5

Views: 3998

Answers (3)

Seyed Parsa Neshaei
Seyed Parsa Neshaei

Reputation: 3520

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

You can use HealthKit (HK) functions and classes in order to calculate burned calories, find heart rate, etc.

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

Read developer documentations from Apple in order to learn about HealthKit. They can be found in developer.apple.com.

Resources

For more details about HKWorkout, you should check out the HKWorkout Class Reference and the HKWorkoutSession Class Reference from Apple.

Also don't forget to check out this great WWDC15 video.

Upvotes: 3

lehn0058
lehn0058

Reputation: 20257

Apple isn't technically giving developers access to the heart rate sensors in watchOS 2.0. What they are doing is providing direct access to heart rate data recorded by the sensor in HealthKit. See the stack overflow answer to this question for more detail.

Upvotes: 4

John
John

Reputation: 8548

watchOS 2 allows you to use HealthKit. Within this kit, you may use HKWorkout to access variables such as the heart rate.

Upvotes: 7

Related Questions