Compare HKSample with another HKSample to prevent duplicates

Viewed 224

[Swift 3.0]

I am trying to retrieve an HKSample from HealthKit to add data to my application and would also like to update the application whenever HealthKit is.

I have added an HKObserverQuery and it works. However, it does not check whether the HKSample already exists in my application before it adds it and continuously adds the sample to my application.

How can I check if an HKSample with identical properties already exist?

1 Answers
Related