Commit 8908d27e authored by Daniele Volpi's avatar Daniele Volpi

added unit types (bpm, celsius, fahrenheit) and updated constants

parent c6eba40f
...@@ -225,6 +225,18 @@ ...@@ -225,6 +225,18 @@
if([unitString isEqualToString:@"percent"]){ if([unitString isEqualToString:@"percent"]){
theUnit = [HKUnit percentUnit]; theUnit = [HKUnit percentUnit];
} }
if([unitString isEqualToString:@"bpm"]){
HKUnit *count = [HKUnit countUnit];
HKUnit *minute = [HKUnit minuteUnit];
theUnit = [count unitedDividedByUnit:minute];
}
if([unitString isEqualToString:@"fahrenheit"]){
theUnit = [HKUnit degreeFahrenheitUnit];
}
if([unitString isEqualToString:@"celsius"]){
theUnit = [HKUnit degreeCelsiusUnit];
}
if(theUnit == nil){ if(theUnit == nil){
theUnit = defaultValue; theUnit = defaultValue;
......
...@@ -42,7 +42,10 @@ const UNITS = { ...@@ -42,7 +42,10 @@ const UNITS = {
joule: 'joule', joule: 'joule',
calorie: 'calorie', calorie: 'calorie',
count: 'count', count: 'count',
percent: 'percent' percent: 'percent',
bpm: 'bpm',
fahrenheit: 'fahrenheit',
celsius: 'celsius',
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment