-
-
Save max6363/580e82e1b6e80355b4120dc5ab7aa041 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
/** | |
On Write Steps Action | |
*/ | |
- (IBAction)onWriteStepsAction:(id)sender { | |
// Steps | |
NSInteger steps = 100; | |
// Get date | |
NSDate *now = [NSDate date]; | |
// Get startdate (before 60 seconds from now) | |
NSDate *startDate = [now dateByAddingTimeInterval:-60]; | |
// Set end date | |
NSDate *endDate = now; | |
// Write steps with startdate, enddate | |
[[HealthKitManager sharedInstance] writeSteps:steps | |
startDate:startDate | |
endDate:endDate withFinishBlock:^(NSError *error) { | |
// result block | |
if (error) { | |
// handle error | |
NSLog(@"error : %@",error); | |
} else { | |
// success writing steps | |
} | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment