Created
May 8, 2018 18:05
-
-
Save max6363/ee863d94fc8bcd67d89ab1aaa8b1574b 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
#import "HealthKitManager.h" | |
#import <HealthKit/HealthKit.h> | |
@interface HealthKitManager () | |
@property (nonatomic, retain) HKHealthStore *healthStore; | |
@end | |
@implementation HealthKitManager | |
// shared instance | |
+ (HealthKitManager *)sharedInstance { | |
static HealthKitManager *instance = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
instance = [[HealthKitManager alloc] init]; | |
}); | |
return instance; | |
} | |
// init | |
- (id)init { | |
self = [super init]; | |
if (self) { | |
self.healthStore = [[HKHealthStore alloc] init]; | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment