Skip to content

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

License

Notifications You must be signed in to change notification settings

WrightsCS/WCSHealthkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published