Class

HKSampleType

An abstract superclass for all classes that identify a specific type of sample when working with the HealthKit store.

Declaration

class HKSampleType : HKObjectType

Overview

The HKSampleType class is an abstract subclass of the HKObjectType class, used to represent data samples. Never instantiate an HKSampleType object directly. Instead, work with one of its concrete subclasses: HKCategoryType, HKCorrelationType, HKQuantityType, or HKWorkoutType classes.

Topics

Checking the Duration Restriction

var isMinimumDurationRestricted: Bool

A Boolean value that indicates whether samples of this type have a minimum time interval between the start and end dates.

var minimumAllowedDuration: TimeInterval

The minimum duration if the sample type has a restricted duration.

var isMaximumDurationRestricted: Bool

A Boolean value that indicates whether samples of this type have a maximum time interval between the start and end dates.

var maximumAllowedDuration: TimeInterval

The maximum duration if the sample type has a restricted duration.

Relationships

Inherits From

Conforms To

See Also

Type Objects

class HKCharacteristicType

A type that represents data that does not typically change over time.

class HKQuantityType

A type that identifies samples that store numerical values.

class HKCategoryType

A type that identifies samples that contain a value from a small set of possible values.

class HKCorrelationType

A type that identifies samples that group multiple subsamples.

class HKActivitySummaryType

A type that identifies activity summary objects.

class HKAudiogramSampleType

A type that identifies samples that contain audiogram data.

class HKSeriesType

A type that indicates the data stored in a series sample.

class HKObjectType

The abstract superclass for all classes that identify a specific type of data when working with the HealthKit store.

class HKClinicalType

A type that identifies samples that contain clinical record data.

class HKWorkoutType

A type that identifies samples that store information about a workout.