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

# predicateForUserAnnotatedMedications(hasSchedule:)

## Declaration

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

## Parameters

- `hasSchedule`: The schedule status of the medication. Ex: True will match medications that have a reminders schedule set up in the Health App.

## Discussion

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