What's new in HealthKit

RSS for tag

Discuss the WWDC22 Session What's new in HealthKit

Posts under wwdc2022-10005 tag

6 Posts
Sort by:
Post not yet marked as solved
1 Replies
161 Views
I'm using watchOS 9 beta 2 and I'm not getting the new running metrics in my workout app. Using HKLiveWorkoutDataSource attached to a HKWorkoutBuilder ActivityType is running Tried enabling the collection of the new metrics According to Jorge M in the WWDC labs: "Yes, the new running metrics are also available for 3rd party applications. If you are using an HKLiveWorkoutDataSource attached to a HKWorkoutBuilder in your application, the new metrics would be collected by default." The Health app does not show any Related Samples for these types. Am I doing something wrong or are they not available yet to 3rd party workouts? I do see them for the Apple Workout app.
Posted
by jbailey.
Last updated
.
Post not yet marked as solved
1 Replies
134 Views
Hi. is there a explicit HKQuantityTypeIdentifier for the new Cadence value in iOS 16. I only can find in the documentation HKQuantityTypeIdentifier runningPower runningSpeed runningStrideLength runningVerticalOscillation runningGroundContactTime But nothing like runningCadence???
Posted
by boerni.
Last updated
.
Post not yet marked as solved
1 Replies
105 Views
Will developers be able to access the AFib History feature coming to WatchOS 9? I work as an Epic Analyst for a local hospital in the digital health department and one of our programs uses the Apple Watch for AFib detection and I just wanted to make sure we would be able to access that info (with permission of course) through our own app.
Posted
by Thulse1.
Last updated
.
Post not yet marked as solved
0 Replies
118 Views
Is it possible to set TotalDistance for the sorts of HKSampleQueryDescriptor? In HKSampleQuery, I can set TotalDistance as follows. let sort = NSSortDescriptor(key: HKWorkoutSortIdentifierTotalDistance, ascending: false) let type = HKWorkoutType.workoutType() let query = HKSampleQuery(sampleType: type, predicate: nil, limit: 0, sortDescriptors: [sort] ){ (query, results, error) -> Void in } I want to create a SortDescriptor for HKSampleQueryDescriptor. When I set HKWorkout.totalDistance to parameter in SortDescriptor, the compile error occurred. let sort = SortDescriptor(\HKWorkout.totalDistance, order: .forward) // Error: "No exact matches in call to initializer" I know that HKWorkout.totalDistance is deprecated. Isn't it recommended to set TotalDistance to sort? I'm expecting that on iOS 16, I can get my workouts in heart rate order, is this a mistake?
Posted
by aqubi.
Last updated
.
Post not yet marked as solved
0 Replies
109 Views
let stepType = HKQuantityType(.stepCount)         let stepsThisWeek = HKSamplePredicate.quantitySample(type: stepType, predicate: thisWeek)         let yesterday = calendar.date(byAdding: .day, value: -1, to: calendar.startOfDay(for: now))         let every5 = DateComponents(minute:5)         let healthTypes = Set([             HKCategoryType.categoryType(forIdentifier: .handwashingEvent)!         ])         let sumOfStepsQuery = HKStatisticsCollectionQueryDescriptor(             predicate: stepsThisWeek,             options: .cumulativeSum,             anchorDate: endDate,             intervalComponents: every5)         do {             let updateQueue = sumOfStepsQuery.results(for: store)             // Wait for the initial results and updates.             updateQueue = Task {                 for try await results in updateQueue {                     // Use the statistics collection here.                 }             }                      } catch {             //handle error             print(error)         }
Posted
by kotran.
Last updated
.