Last active
January 23, 2020 15:04
-
-
Save FedeRotoli/60670b3726e5fd6e5edc2492e802a055 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func process(_ samples: [HKQuantitySample], type: HKQuantityTypeIdentifier) { | |
var lastHeartRate = 0.0 | |
for sample in samples { | |
if type == .heartRate { | |
lastHeartRate = sample.quantity.doubleValue(for: heartRateQuantity) | |
} | |
self.value = Int(lastHeartRate) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment