// the take
A minimal watchOS 2 sample app showing how to request HealthKit authorization from the watch and stream live heart rate by starting an HKWorkoutSession, paired with a bare iOS host app. It's aimed at a developer in 2015-2016 trying to reverse-engineer the then-undocumented workout-session trick for keeping heart rate sampling alive in the background.
Demonstrates the actual trick that mattered at the time: wrapping the HealthKit heart rate query in an HKWorkoutSession so iOS doesn't suspend sampling, which wasn't clearly documented by Apple then. The codebase is tiny (essentially ExtensionDelegate.swift and InterfaceController.swift), so you can read the whole HealthKit setup in one sitting instead of digging through a framework. The author tracked watchOS betas 3 and 4 with API updates and pointed users to a watchOS 3 rewrite instead of abandoning the repo mid-API-change.
Last commit is from 2019 and the project targets Xcode 7 / watchOS 2 SDK with what reads as Swift 2 syntax — it will not build on a current toolchain without a real port, not a quick tweak. There's no handling for HealthKit authorization being denied or a workout session getting interrupted, which is the first thing that breaks in real use. It's a one-off demo app, not a library or package: there's nothing to depend on, only code to copy out, and the successor watchOS 3 repo it points to is itself unmaintained since 2016.
We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →