Skip to content

Latest commit

 

History

History
37 lines (20 loc) · 1.05 KB

README.md

File metadata and controls

37 lines (20 loc) · 1.05 KB

WCSHealthkit

Healthkit example that demonstrates how to authorize, read from and write to HealthKit.

Authorize

On success you can reload your parent view controller and reload any data that you will be reading from.

- (void)authorize:(void (^)(BOOL success))completion;

Read

Date of birth (MM-dd-yyyy format)

- (NSString*)birthday;

Retrieve stored height, weight

- (void)height:(void (^)(double height))completion;
- (void)weight:(void (^)(double weight))completion;

Steps since midnight

- (void)steps:(void (^)(double steps))completion;

Calories (resting, active, dietary)

- (void)energy:(void (^)(NSString * energy))completion;

Write

Record steps (incremental), height, weight

- (void)recordSteps:(double)increment completion:(void (^)(BOOL recorded, NSError * error))completion;
- (void)recordHeight:(double)height completion:(void (^)(BOOL recorded, NSError * error))completion;
- (void)recordWeight:(double)weight completion:(void (^)(BOOL recorded, NSError * error))completion;