Skip to content

Instantly share code, notes, and snippets.

@max6363
Created May 8, 2018 18:05
Show Gist options
  • Save max6363/ee863d94fc8bcd67d89ab1aaa8b1574b to your computer and use it in GitHub Desktop.
Save max6363/ee863d94fc8bcd67d89ab1aaa8b1574b to your computer and use it in GitHub Desktop.
#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