<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKCategoryValuePredicateProviding",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "s:9HealthKit33HKCategoryValuePredicateProvidingP"
  },
  "title" : "HKCategoryValuePredicateProviding"
}
-->

# HKCategoryValuePredicateProviding

A protocol for objects that produce predicates that match category value samples.

```
protocol HKCategoryValuePredicateProviding : Hashable, RawRepresentable
```

## Topics

### Creating predicates

[`static func predicateForSamples(NSComparisonPredicate.Operator, value: Self) -> NSPredicate`](/documentation/HealthKit/HKCategoryValuePredicateProviding/predicateForSamples(_:value:))

Returns a predicate that checks a category sample’s value.

[`static func predicateForSamples(equalTo: Set<Self>) -> NSPredicate`](/documentation/HealthKit/HKCategoryValuePredicateProviding/predicateForSamples(equalTo:))

Returns a predicate that checks whether a category sample is equal to the provided set of values.

## Relationships

### Conforming Types

[`HKCategoryValuePresence`](/documentation/HealthKit/HKCategoryValuePresence)

[`HKCategoryValueAppleWalkingSteadinessEvent`](/documentation/HealthKit/HKCategoryValueAppleWalkingSteadinessEvent)

[`HKCategoryValue`](/documentation/HealthKit/HKCategoryValue)

[`HKCategoryValueHeadphoneAudioExposureEvent`](/documentation/HealthKit/HKCategoryValueHeadphoneAudioExposureEvent)

[`HKCategoryValueCervicalMucusQuality`](/documentation/HealthKit/HKCategoryValueCervicalMucusQuality)

[`HKCategoryValueVaginalBleeding`](/documentation/HealthKit/HKCategoryValueVaginalBleeding)

[`HKCategoryValueProgesteroneTestResult`](/documentation/HealthKit/HKCategoryValueProgesteroneTestResult)

[`HKCategoryValueMenstrualFlow`](/documentation/HealthKit/HKCategoryValueMenstrualFlow)

[`HKCategoryValueSeverity`](/documentation/HealthKit/HKCategoryValueSeverity)

[`HKCategoryValueAppleStandHour`](/documentation/HealthKit/HKCategoryValueAppleStandHour)

[`HKCategoryValueMenopausalState`](/documentation/HealthKit/HKCategoryValueMenopausalState)

[`HKCategoryValueSleepAnalysis`](/documentation/HealthKit/HKCategoryValueSleepAnalysis)

[`HKCategoryValueEnvironmentalAudioExposureEvent`](/documentation/HealthKit/HKCategoryValueEnvironmentalAudioExposureEvent)

[`HKCategoryValueLowCardioFitnessEvent`](/documentation/HealthKit/HKCategoryValueLowCardioFitnessEvent)

[`HKCategoryValueOvulationTestResult`](/documentation/HealthKit/HKCategoryValueOvulationTestResult)

[`HKCategoryValuePregnancyTestResult`](/documentation/HealthKit/HKCategoryValuePregnancyTestResult)

[`HKCategoryValueContraceptive`](/documentation/HealthKit/HKCategoryValueContraceptive)

[`HKCategoryValueAppetiteChanges`](/documentation/HealthKit/HKCategoryValueAppetiteChanges)

### Inherits From

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Equatable`](/documentation/Swift/Equatable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)