Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift HealthKit-积累在watchOS 4中燃烧的能量_Swift_Watchkit_Healthkit_Watchos 4 - Fatal编程技术网

Swift HealthKit-积累在watchOS 4中燃烧的能量

Swift HealthKit-积累在watchOS 4中燃烧的能量,swift,watchkit,healthkit,watchos-4,Swift,Watchkit,Healthkit,Watchos 4,在watchOS 3中,当您想要积累燃烧的能量时,可以使用以下方法: totalEnergyBurned.addQuantities(from: samples, unit: HKUnit.calorie()) 现在在WatchOS 4中,HKUnit.carolie()已被弃用,并已被HKUnit.smallcarolie()和HKUnit.largecarolie()取代 那么,为了测量现在燃烧的能量,我们是累积smallcarorie(),largecarorie(),还是两者兼而有之

在watchOS 3中,当您想要积累燃烧的能量时,可以使用以下方法:

totalEnergyBurned.addQuantities(from: samples, unit: HKUnit.calorie())
现在在WatchOS 4中,HKUnit.carolie()已被弃用,并已被
HKUnit.smallcarolie()
HKUnit.largecarolie()
取代

那么,为了测量现在燃烧的能量,我们是累积
smallcarorie()
largecarorie()
,还是两者兼而有之

不幸的是,今天的苹果文档仍处于测试阶段,并没有告诉我们太多。

根据,
HKUnit.carorie()
代表克卡路里。出于同样的目的,您应该使用
小卡路里(也称为克卡路里)

大卡路里
=
小卡路里
*1000