From 43535158a7138d2c9196a93d3b14c0963e80af85 Mon Sep 17 00:00:00 2001 From: skleest Date: Wed, 18 Jan 2017 15:48:35 -0800 Subject: [PATCH] typos --- .../RCTAppleHealthKit+Methods_Mindfulness.m | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Mindfulness.m b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Mindfulness.m index 8a8a67c..3fe42f0 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Mindfulness.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Mindfulness.m @@ -14,6 +14,7 @@ - (void)mindfulness_saveMindfulSession:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback { + double value = [RCTAppleHealthKit doubleFromOptions:input key:@"value" withDefault:(double)0]; NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil]; NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]]; @@ -22,14 +23,8 @@ return; } - // original - HKQuantity *quantity = [HKQuantity quantityWithUnit:unit doubleValue:value]; - HKQuantityType *type = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount]; - HKQuantitySample *sample = [HKQuantitySample categorySampleWithType:type quantity:quantity startDate:startDate endDate:endDate]; - - // new HKCategoryType *type = [HKCategoryType categoryTypeForIdentifier: HKCategoryTypeIdentifierMindfulSession]; - HKCategorySample *sample = [HKCategorySample categorySampleWithType:type value:nil startDate:startDate endDate:endDate]; + HKCategorySample *sample = [HKCategorySample categorySampleWithType:type value:value startDate:startDate endDate:endDate]; [self.healthStore saveObject:sample withCompletion:^(BOOL success, NSError *error) { -- 2.26.2