Combine is a powerful framework for writing asynchronous code. It provides building blocks like Publishers and operators that allow programmers to write complex data pipelines, network calls, and so on. HealthKit is another framework provided by Apple, and it manages reading and writing health-related data. It’s available on iOS and watchOS.
In this article, I will explore how Combine can be used to implement some HealthKit basic functionalities — namely requesting access to read user data and querying that data.
Requesting authorization is an important step, and we need to do it before querying any health data. Users can change…
I write swifty bugs. Previously at @Apple, Apple Developer Academy, WWDC17 Scholar.