HealthKit - 积累在 watchOS 4 中燃烧的能量
HealthKit - accumulate energy burned in watchOS 4
在 watchOS 3 中,当你想积累消耗的能量时,你可以使用类似这样的东西:
totalEnergyBurned.addQuantities(from: samples, unit: HKUnit.calorie())
现在在 WatchOS 4 中,HKUnit.calorie() 已弃用并已被 HKUnit.smallCalorie()
和 HKUnit.largeCalorie()
取代。
那么,要测量现在燃烧的能量,我们是累积 smallCalorie()
、largeCalorie()
还是两者都累积?
不幸的是,今天的 Apple 文档仍处于测试阶段,并没有告诉我们太多信息。
根据Apple's documentation,HKUnit.calorie()
代表克卡路里。您应该使用 smallCalorie
(a.k.a。克卡路里)用于相同的目的。
largeCalorie
= smallCalorie
* 1000
在 watchOS 3 中,当你想积累消耗的能量时,你可以使用类似这样的东西:
totalEnergyBurned.addQuantities(from: samples, unit: HKUnit.calorie())
现在在 WatchOS 4 中,HKUnit.calorie() 已弃用并已被 HKUnit.smallCalorie()
和 HKUnit.largeCalorie()
取代。
那么,要测量现在燃烧的能量,我们是累积 smallCalorie()
、largeCalorie()
还是两者都累积?
不幸的是,今天的 Apple 文档仍处于测试阶段,并没有告诉我们太多信息。
根据Apple's documentation,HKUnit.calorie()
代表克卡路里。您应该使用 smallCalorie
(a.k.a。克卡路里)用于相同的目的。
largeCalorie
= smallCalorie
* 1000