ios - 从HealthKit查询中检索HKWorkoutTypeIdentifier

标签 ios apple-watch healthkit

在HealthKit查询中,有没有办法检索用于存储数据的原始HKWorkoutTypeIdentifier?
我知道您可以使用HKWorkoutTypeIdentifier来查询特定的锻炼类型;但是,那不是我想要做的。我要回答的问题是“用户进行了哪些类型的锻炼?”
Apple Health应用程序以及一些第三方应用程序都有一个列表。但是我不知道他们是如何做到的。
有任何想法吗?

最佳答案

从查询返回样本后,就可以在每个锻炼样本上使用.workoutActivityType来访问为该样本设置的 HKWorkoutActivityType

关于ios - 从HealthKit查询中检索HKWorkoutTypeIdentifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63459534/

相关文章:

ios - ObjC 中的静态与 Swift 中的静态

php - 使用 iOS 模拟器进行简单的文本检索

javascript - Canvas 不会在带有 cordova 和 pixi.js 的 iphone 上呈现

ios - 重复的模块名称 : react-native

ios - Apple Watch 套件在启动时加载数据

ios - 从通知中心打开推送时 Apple Watch : dynamic Long Look not shown,

ios - containerURLForSecurityApplicationGroupIdentifier : gives different results on iPhone and Watch simulator

ios - 开始日期、结束日期以及在 ViewController 中向标签添加文本

ios - 我需要阅读哪个 swift 文档或视频才能了解此 ResultsHandler 的工作原理?

ios - 使用 HealthKit 的应用程序图标未出现在事件应用程序中