HKCategoryTypeIdentifierMindfulSession
对应的
HKCategoryValue
为
HKCategoryValueNotApplicable
HKCategoryType *categoryType = [HKCategoryType categoryTypeForIdentifier:HKCategoryTypeIdentifierMindfulSession];
HKCategorySample *mindness = [HKCategorySample categorySampleWithType:categoryType value:HKCategoryValueNotApplicable startDate:breathModel.startDate endDate:breathModel.endDate];
[_healthStore saveObjects:@[mindness] withCompletion:^(BOOL success, NSError * _Nullable error) {
if (success) {
NSLog(@"保存成功");
} else
{
NSLog(@"保存失败 %@", error);
}
}];