---
title: "predicateForUserAnnotatedMedications(isArchived:)"
framework: healthkit
role: symbol
role_heading: Type Method
path: "healthkit/hkquery/predicateforuserannotatedmedications(isarchived:)"
---

# predicateForUserAnnotatedMedications(isArchived:)

## Declaration

```swift
class func predicateForUserAnnotatedMedications(isArchived: Bool) -> NSPredicate
```

## Parameters

- `isArchived`: The archived status of the medication. Ex: True will match medications in the archived section in the Health App.

## Discussion

Discussion Creates a predicate for use with HKUserAnnotatedMedicationQuery. Creates a query predicate that matches HKUserAnnotatedMedication objects that have the archived status specified.
