Skip to content

Instantly share code, notes, and snippets.

@scottmkroberts
Created July 25, 2014 15:56
Show Gist options
  • Save scottmkroberts/2069e1632b10388a59e7 to your computer and use it in GitHub Desktop.
Save scottmkroberts/2069e1632b10388a59e7 to your computer and use it in GitHub Desktop.
Part of my HealthKitFormatter Class
//
// HealthKitFormatter.m
// HealthKitExample
//
// Created by Scott Roberts on 24/07/2014.
// Copyright (c) 2014 Scottr. All rights reserved.
//
#import "HealthKitFormatter.h"
@implementation HealthKitFormatter
NSString *const NotSetConstant = @"Not Set";
#pragma mark - Personal Formatters
+(NSString *)bloodTypeDescription:(HKBloodTypeObject *)bloodType{
switch (bloodType.bloodType) {
case HKBloodTypeNotSet:
return NotSetConstant;
break;
case HKBloodTypeAPositive:
return @"A Positive";
break;
case HKBloodTypeANegative:
return @"A Negative";
break;
case HKBloodTypeBPositive:
return @"B Positive";
break;
case HKBloodTypeBNegative:
return @"B Negative";
break;
case HKBloodTypeABPositive:
return @"AB Positive";
break;
case HKBloodTypeABNegative:
return @"AB Negative";
break;
case HKBloodTypeOPositive:
return @"O Positive";
break;
case HKBloodTypeONegative:
return @"O Negative";
break;
default:
return NotSetConstant;
break;
}
}
+(NSString *)biologicalSexDescription:(HKBiologicalSexObject *)bioSex{
switch (bioSex.biologicalSex) {
case HKBiologicalSexNotSet:
return NotSetConstant;
break;
case HKBiologicalSexFemale:
return @"Female";
break;
case HKBiologicalSexMale:
return @"Male";
break;
default:
break;
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment