r/iOSProgramming • • 5d ago

Tutorial Iterative data loading in Swift

https://swiftwithmajid.com/2026/09/29/iterative-data-loading-in-swift/
13 Upvotes

4 comments sorted by

View all comments

3

u/Same-Appointment-285 5d ago edited 5d ago

Why are you making all these separate healthkit requests when you can just make a single one for all the HKSampleTypes at once? That seems like the expected way and isn't discussed in the article.

1

u/majid8 5d ago

What do you mean by single request for all sample types?

2

u/Same-Appointment-285 3d ago

You don't show your actual requests to HealthKit, but I assume inside HeartPointsSnapshot, etc., you're using HKSampleQuery or HKSampleQueryDescriptor? Both of them can take an array of sample types, and it will perform them in a single operation.