I use this function to get calories burned from Health Kit after syncing with RunKeeper
func getActiveEnergy(currentDate: Date ,completion: @escaping ((_ totalEn
sovlved the problem with the link below: https://developer.apple.com/reference/healthkit/hkstatisticscollectionquery