One Logo Pool Ball
HealthKit · IOS API REFERENCE

HKQuery

class · iOS 8.0+ · SDK 27.1

class HKQuery

Members (58)

static · iOS 9.3+

predicate

TypeScript
static predicateForActivitySummariesBetweenStartEnd(startDateComponents: _Foundation_DateComponents, endDateComponents: _Foundation_DateComponents): _Foundation_NSPredicate
Swift declaration
class func predicate(forActivitySummariesBetweenStart startDateComponents: DateComponents, end endDateComponents: DateComponents) -> NSPredicate
static · iOS 9.3+

predicateForActivitySummary

TypeScript
static predicateForActivitySummary(dateComponents: _Foundation_DateComponents): _Foundation_NSPredicate
Swift declaration
class func predicateForActivitySummary(with dateComponents: DateComponents) -> NSPredicate
static · iOS 8.0+ · Deprecated in iOS 100000.0

predicateForCategorySamples

TypeScript
static predicateForCategorySamples(operatorType: _Foundation_NSComparisonPredicate_Operator, value: number): _Foundation_NSPredicate
Swift declaration
class func predicateForCategorySamples(with operatorType: NSComparisonPredicate.Operator, value: Int) -> NSPredicate
static · iOS 12.0+

predicateForClinicalRecords

TypeScript
static predicateForClinicalRecordsFromFhirResourceTypeIdentifier(source: HKSource, resourceType: HKFHIRResourceType, identifier: string): _Foundation_NSPredicate
Swift declaration
class func predicateForClinicalRecords(from source: HKSource, fhirResourceType resourceType: HKFHIRResourceType, identifier: String) -> NSPredicate
static · iOS 12.0+

predicateForClinicalRecords

TypeScript
static predicateForClinicalRecordsWithFHIRResourceType(resourceType: HKFHIRResourceType): _Foundation_NSPredicate
Swift declaration
class func predicateForClinicalRecords(withFHIRResourceType resourceType: HKFHIRResourceType) -> NSPredicate
static · iOS 14.0+

predicateForElectrocardiograms

TypeScript
static predicateForElectrocardiogramsClassification(classification: HKElectrocardiogram_Classification): _Foundation_NSPredicate
Swift declaration
class func predicateForElectrocardiograms(classification: HKElectrocardiogram.Classification) -> NSPredicate
static · iOS 14.0+

predicateForElectrocardiograms

TypeScript
static predicateForElectrocardiogramsSymptomsStatus(symptomsStatus: HKElectrocardiogram_SymptomsStatus): _Foundation_NSPredicate
Swift declaration
class func predicateForElectrocardiograms(symptomsStatus: HKElectrocardiogram.SymptomsStatus) -> NSPredicate
static · iOS 26.0+

predicateForMedicationDoseEvent

TypeScript
static predicateForMedicationDoseEventMedicationConceptIdentifier(medicationConceptIdentifier: HKHealthConceptIdentifier): _Foundation_NSPredicate
Swift declaration
class func predicateForMedicationDoseEvent(medicationConceptIdentifier: HKHealthConceptIdentifier) -> NSPredicate
static · iOS 26.0+

predicateForMedicationDoseEvent

TypeScript
static predicateForMedicationDoseEventMedicationConceptIdentifiers(medicationConceptIdentifiers: Array<HKHealthConceptIdentifier>): _Foundation_NSPredicate
Swift declaration
class func predicateForMedicationDoseEvent(medicationConceptIdentifiers: Set<HKHealthConceptIdentifier>) -> NSPredicate
static · iOS 26.0+

predicateForMedicationDoseEvent

TypeScript
static predicateForMedicationDoseEventScheduledDate(scheduledDate: globalThis.Date): _Foundation_NSPredicate
Swift declaration
class func predicateForMedicationDoseEvent(scheduledDate: Date) -> NSPredicate
static · iOS 26.0+

predicateForMedicationDoseEvent

TypeScript
static predicateForMedicationDoseEventScheduledDates(scheduledDates: Array<globalThis.Date>): _Foundation_NSPredicate
Swift declaration
class func predicateForMedicationDoseEvent(scheduledDates: Set<Date>) -> NSPredicate
static · iOS 26.0+

predicateForMedicationDoseEvent

TypeScript
static predicateForMedicationDoseEventScheduledStartEnd(startDate?: (globalThis.Date) | null, endDate?: (globalThis.Date) | null): _Foundation_NSPredicate
Swift declaration
class func predicateForMedicationDoseEvent(scheduledStart startDate: Date?, end endDate: Date?) -> NSPredicate
static · iOS 26.0+

predicateForMedicationDoseEvent

TypeScript
static predicateForMedicationDoseEventStatus(status: HKMedicationDoseEvent_LogStatus): _Foundation_NSPredicate
Swift declaration
class func predicateForMedicationDoseEvent(status: HKMedicationDoseEvent.LogStatus) -> NSPredicate
static · iOS 26.0+

predicateForMedicationDoseEvent

TypeScript
static predicateForMedicationDoseEventStatuses(statuses: Array<_Foundation_NSNumber>): _Foundation_NSPredicate
Swift declaration
class func predicateForMedicationDoseEvent(statuses: Set<NSNumber>) -> NSPredicate
static

predicateForObject

TypeScript
static predicateForObject(UUID: string): _Foundation_NSPredicate
Swift declaration
class func predicateForObject(with UUID: UUID) -> NSPredicate
static · iOS 14.0+

predicateForObjectsAssociated

TypeScript
static predicateForObjectsAssociated(electrocardiogram: HKElectrocardiogram): _Foundation_NSPredicate
Swift declaration
class func predicateForObjectsAssociated(electrocardiogram: HKElectrocardiogram) -> NSPredicate
static · iOS 9.0+

predicateForObjects

TypeScript
static predicateForObjectsFrom(devices: Array<HKDevice>): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(from devices: Set<HKDevice>) -> NSPredicate
static

predicateForObjects

TypeScript
static predicateForObjectsFrom84340(source: HKSource): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(from source: HKSource) -> NSPredicate
static · iOS 9.0+

predicateForObjects

TypeScript
static predicateForObjectsFrom12058(sourceRevisions: Array<HKSourceRevision>): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(from sourceRevisions: Set<HKSourceRevision>) -> NSPredicate
static

predicateForObjects

TypeScript
static predicateForObjectsFrom41455(sources: Array<HKSource>): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(from sources: Set<HKSource>) -> NSPredicate
static

predicateForObjects

TypeScript
static predicateForObjectsFrom74200(workout: HKWorkout): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(from workout: HKWorkout) -> NSPredicate
static · iOS 9.0+

predicateForObjects

TypeScript
static predicateForObjectsWithDevicePropertyAllowedValues(key: string, allowedValues: Array<string>): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(withDeviceProperty key: String, allowedValues: Set<String>) -> NSPredicate
static

predicateForObjects

TypeScript
static predicateForObjectsWithMetadataKey(key: string): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(withMetadataKey key: String) -> NSPredicate
static

predicateForObjects

TypeScript
static predicateForObjectsWithMetadataKeyAllowedValues(key: string, allowedValues: Array<unknown>): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(withMetadataKey key: String, allowedValues: [Any]) -> NSPredicate
static

predicateForObjects

TypeScript
static predicateForObjectsWithMetadataKeyOperatorTypeValue(key: string, operatorType: _Foundation_NSComparisonPredicate_Operator, value: unknown): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(withMetadataKey key: String, operatorType: NSComparisonPredicate.Operator, value: Any) -> NSPredicate
static

predicateForObjectsWithNoCorrelation

TypeScript
static predicateForObjectsWithNoCorrelation(): _Foundation_NSPredicate
Swift declaration
class func predicateForObjectsWithNoCorrelation() -> NSPredicate
static

predicateForObjects

TypeScript
static predicateForObjectsWith(UUIDs: Array<string>): _Foundation_NSPredicate
Swift declaration
class func predicateForObjects(with UUIDs: Set<UUID>) -> NSPredicate
static

predicateForQuantitySamples

TypeScript
static predicateForQuantitySamples(operatorType: _Foundation_NSComparisonPredicate_Operator, quantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForQuantitySamples(with operatorType: NSComparisonPredicate.Operator, quantity: HKQuantity) -> NSPredicate
static

predicateForSamples

TypeScript
static predicateForSamples(startDate?: (globalThis.Date) | null, endDate?: (globalThis.Date) | null, options?: HKQueryOptions): _Foundation_NSPredicate
Swift declaration
class func predicateForSamples(withStart startDate: Date?, end endDate: Date?, options: HKQueryOptions = []) -> NSPredicate
static

predicateForStatesOfMind

TypeScript
static predicateForStatesOfMindWith(association: HKStateOfMind_Association): _Foundation_NSPredicate
Swift declaration
class func predicateForStatesOfMind(with association: HKStateOfMind.Association) -> NSPredicate
static

predicateForStatesOfMind

TypeScript
static predicateForStatesOfMindWith92358(kind: HKStateOfMind_Kind): _Foundation_NSPredicate
Swift declaration
class func predicateForStatesOfMind(with kind: HKStateOfMind.Kind) -> NSPredicate
static

predicateForStatesOfMind

TypeScript
static predicateForStatesOfMindWith55314(label: HKStateOfMind_Label): _Foundation_NSPredicate
Swift declaration
class func predicateForStatesOfMind(with label: HKStateOfMind.Label) -> NSPredicate
static

predicateForStatesOfMind

TypeScript
static predicateForStatesOfMindWithValenceOperatorType(valence: number, operatorType: _Foundation_NSComparisonPredicate_Operator): _Foundation_NSPredicate
Swift declaration
class func predicateForStatesOfMind(withValence valence: Double, operatorType: NSComparisonPredicate.Operator) -> NSPredicate
static · iOS 26.0+

predicateForUserAnnotatedMedications

TypeScript
static predicateForUserAnnotatedMedicationsHasSchedule(hasSchedule: boolean): _Foundation_NSPredicate
Swift declaration
class func predicateForUserAnnotatedMedications(hasSchedule: Bool) -> NSPredicate
static · iOS 26.0+

predicateForUserAnnotatedMedications

TypeScript
static predicateForUserAnnotatedMedicationsIsArchived(isArchived: boolean): _Foundation_NSPredicate
Swift declaration
class func predicateForUserAnnotatedMedications(isArchived: Bool) -> NSPredicate
static · iOS 15.0+

predicateForVerifiableClinicalRecords

TypeScript
static predicateForVerifiableClinicalRecords(dateInterval: _Foundation_DateInterval): _Foundation_NSPredicate
Swift declaration
class func predicateForVerifiableClinicalRecords(withRelevantDateWithin dateInterval: DateInterval) -> NSPredicate
static · iOS 16.0+

predicateForWorkoutActivities

TypeScript
static predicateForWorkoutActivitiesOperatorTypeDuration(operatorType: _Foundation_NSComparisonPredicate_Operator, duration: number): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkoutActivities(operatorType: NSComparisonPredicate.Operator, duration: TimeInterval) -> NSPredicate
static · iOS 16.0+

predicateForWorkoutActivities

TypeScript
static predicateForWorkoutActivitiesOperatorTypeQuantityTypeAverageQuantity(operatorType: _Foundation_NSComparisonPredicate_Operator, quantityType: HKQuantityType, averageQuantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkoutActivities(operatorType: NSComparisonPredicate.Operator, quantityType: HKQuantityType, averageQuantity: HKQuantity) -> NSPredicate
static · iOS 16.0+

predicateForWorkoutActivities

TypeScript
static predicateForWorkoutActivitiesOperatorTypeQuantityTypeMaximumQuantity(operatorType: _Foundation_NSComparisonPredicate_Operator, quantityType: HKQuantityType, maximumQuantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkoutActivities(operatorType: NSComparisonPredicate.Operator, quantityType: HKQuantityType, maximumQuantity: HKQuantity) -> NSPredicate
static · iOS 16.0+

predicateForWorkoutActivities

TypeScript
static predicateForWorkoutActivitiesOperatorTypeQuantityTypeMinimumQuantity(operatorType: _Foundation_NSComparisonPredicate_Operator, quantityType: HKQuantityType, minimumQuantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkoutActivities(operatorType: NSComparisonPredicate.Operator, quantityType: HKQuantityType, minimumQuantity: HKQuantity) -> NSPredicate
static · iOS 16.0+

predicateForWorkoutActivities

TypeScript
static predicateForWorkoutActivitiesOperatorTypeQuantityTypeSumQuantity(operatorType: _Foundation_NSComparisonPredicate_Operator, quantityType: HKQuantityType, sumQuantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkoutActivities(operatorType: NSComparisonPredicate.Operator, quantityType: HKQuantityType, sumQuantity: HKQuantity) -> NSPredicate
static · iOS 16.0+

predicateForWorkoutActivities

TypeScript
static predicateForWorkoutActivitiesStartEndOptions(startDate?: (globalThis.Date) | null, endDate?: (globalThis.Date) | null, options?: HKQueryOptions): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkoutActivities(start startDate: Date?, end endDate: Date?, options: HKQueryOptions = []) -> NSPredicate
static · iOS 16.0+

predicateForWorkoutActivities

TypeScript
static predicateForWorkoutActivitiesWorkoutActivityType(workoutActivityType: HKWorkoutActivityType): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkoutActivities(workoutActivityType: HKWorkoutActivityType) -> NSPredicate
static · iOS 18.0+

predicateForWorkoutEffortSamplesRelated

TypeScript
static predicateForWorkoutEffortSamplesRelated(workout: HKWorkout, activity?: (HKWorkoutActivity) | null): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkoutEffortSamplesRelated(workout: HKWorkout, activity: HKWorkoutActivity?) -> NSPredicate
static · iOS 16.0+

predicateForWorkouts

TypeScript
static predicateForWorkoutsActivityPredicate(activityPredicate: _Foundation_NSPredicate): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(activityPredicate: NSPredicate) -> NSPredicate
static

predicateForWorkouts

TypeScript
static predicateForWorkoutsWithDuration(operatorType: _Foundation_NSComparisonPredicate_Operator, duration: number): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(with operatorType: NSComparisonPredicate.Operator, duration: TimeInterval) -> NSPredicate
static · iOS 16.0+

predicateForWorkouts

TypeScript
static predicateForWorkoutsOperatorTypeQuantityTypeAverageQuantity(operatorType: _Foundation_NSComparisonPredicate_Operator, quantityType: HKQuantityType, averageQuantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(operatorType: NSComparisonPredicate.Operator, quantityType: HKQuantityType, averageQuantity: HKQuantity) -> NSPredicate
static · iOS 16.0+

predicateForWorkouts

TypeScript
static predicateForWorkoutsOperatorTypeQuantityTypeMaximumQuantity(operatorType: _Foundation_NSComparisonPredicate_Operator, quantityType: HKQuantityType, maximumQuantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(operatorType: NSComparisonPredicate.Operator, quantityType: HKQuantityType, maximumQuantity: HKQuantity) -> NSPredicate
static · iOS 16.0+

predicateForWorkouts

TypeScript
static predicateForWorkoutsOperatorTypeQuantityTypeMinimumQuantity(operatorType: _Foundation_NSComparisonPredicate_Operator, quantityType: HKQuantityType, minimumQuantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(operatorType: NSComparisonPredicate.Operator, quantityType: HKQuantityType, minimumQuantity: HKQuantity) -> NSPredicate
static · iOS 16.0+

predicateForWorkouts

TypeScript
static predicateForWorkoutsOperatorTypeQuantityTypeSumQuantity(operatorType: _Foundation_NSComparisonPredicate_Operator, quantityType: HKQuantityType, sumQuantity: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(operatorType: NSComparisonPredicate.Operator, quantityType: HKQuantityType, sumQuantity: HKQuantity) -> NSPredicate
static · iOS 8.0+ · Deprecated in iOS 100000.0

predicateForWorkouts

TypeScript
static predicateForWorkoutsWithTotalDistance(operatorType: _Foundation_NSComparisonPredicate_Operator, totalDistance: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(with operatorType: NSComparisonPredicate.Operator, totalDistance: HKQuantity) -> NSPredicate
static · iOS 8.0+ · Deprecated in iOS 18.0

predicateForWorkouts

TypeScript
static predicateForWorkoutsWithTotalEnergyBurned(operatorType: _Foundation_NSComparisonPredicate_Operator, totalEnergyBurned: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(with operatorType: NSComparisonPredicate.Operator, totalEnergyBurned: HKQuantity) -> NSPredicate
static · iOS 11.0+ · Deprecated in iOS 18.0

predicateForWorkouts

TypeScript
static predicateForWorkoutsWithTotalFlightsClimbed(operatorType: _Foundation_NSComparisonPredicate_Operator, totalFlightsClimbed: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(with operatorType: NSComparisonPredicate.Operator, totalFlightsClimbed: HKQuantity) -> NSPredicate
static · iOS 10.0+ · Deprecated in iOS 18.0

predicateForWorkouts

TypeScript
static predicateForWorkoutsWithTotalSwimmingStrokeCount(operatorType: _Foundation_NSComparisonPredicate_Operator, totalSwimmingStrokeCount: HKQuantity): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(with operatorType: NSComparisonPredicate.Operator, totalSwimmingStrokeCount: HKQuantity) -> NSPredicate
static

predicateForWorkouts

TypeScript
static predicateForWorkoutsWith(workoutActivityType: HKWorkoutActivityType): _Foundation_NSPredicate
Swift declaration
class func predicateForWorkouts(with workoutActivityType: HKWorkoutActivityType) -> NSPredicate
get · iOS 9.3+

objectType

TypeScript
get objectType(): (HKObjectType) | null
Swift declaration
var objectType: HKObjectType? { get }
get · iOS 8.0+

predicate

TypeScript
get predicate(): (_Foundation_NSPredicate) | null
Swift declaration
var predicate: NSPredicate? { get }
get · iOS 8.0+ · Deprecated in iOS 9.3

sampleType

TypeScript
get sampleType(): (HKSampleType) | null
Swift declaration
var sampleType: HKSampleType? { get }

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

HKQuery.init()

inherited init: clang: 'init' is unavailable

All HealthKit types →