Type Method

audiogramSampleWithSensitivityPoints:startDate:endDate:metadata:

Creates a new audiogram sample.

Declaration

+ (instancetype)audiogramSampleWithSensitivityPoints:(NSArray<HKAudiogramSensitivityPoint *> *)sensitivityPoints startDate:(NSDate *)startDate endDate:(NSDate *)endDate metadata:(NSDictionary<NSString *,id> *)metadata;

Parameters

sensitivityPoints

An array of sensitivity points.

start

The start date for the sample. This date must be equal to or earlier than the end date; otherwise, this method throws an exception (NSInvalidArgumentException).

end

The end date for the sample. This date must be equal to or later than the start date; otherwise, this method throws an exception (NSInvalidArgumentException).

metadata

The metadata dictionary contains extra information describing this sample. The dictionary’s keys are strings. The values may be strings, numbers, or dates. For a complete list of predefined metadata keys, see Metadata Keys.

Using predefined keys helps facilitate sharing data between apps; however, you are also encouraged to create your own, custom keys as needed to extend the HealthKit quantity sample’s capabilities.