---
title: "predicateForObjects(with:)"
framework: healthkit
role: symbol
role_heading: Type Method
path: "healthkit/hkquery/predicateforobjects(with:)"
---

# predicateForObjects(with:)

Returns a predicate that matches the objects with the specified  universally unique identifiers (UUIDs).

## Declaration

```swift
class func predicateForObjects(with UUIDs: Set<UUID>) -> NSPredicate
```

## Parameters

- `UUIDs`: The set of UUIDs to be matched.

## Return Value

Return Value A predicate that matches the specified objects based on their UUIDs.

## Discussion

Discussion HealthKit assigns a UUID to each object when it is saved to the HealthKit store. HealthKit uses these IDs to uniquely identify objects from the store. Use this convenience method to create a predicate that checks an object’s UUID against the provided set of UUIDs. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.

## See Also

### Related Documentation

- [HKPredicateKeyPathUUID](healthkit/hkpredicatekeypathuuid.md)
- [uuid](healthkit/hkobject/uuid.md)

### Creating object predicates

- [predicateForObject(with:)](healthkit/hkquery/predicateforobject(with:).md)
- [predicateForObjects(from:)](healthkit/hkquery/predicateforobjects(from:)-7j3p2.md)
- [predicateForObjects(from:)](healthkit/hkquery/predicateforobjects(from:)-89b4t.md)
- [predicateForObjects(from:)](healthkit/hkquery/predicateforobjects(from:)-9h87f.md)
- [predicateForObjects(withDeviceProperty:allowedValues:)](healthkit/hkquery/predicateforobjects(withdeviceproperty:allowedvalues:).md)
- [predicateForObjects(from:)](healthkit/hkquery/predicateforobjects(from:)-1ar4g.md)
- [predicateForObjects(withMetadataKey:)](healthkit/hkquery/predicateforobjects(withmetadatakey:).md)
- [predicateForObjects(withMetadataKey:allowedValues:)](healthkit/hkquery/predicateforobjects(withmetadatakey:allowedvalues:).md)
- [predicateForObjects(withMetadataKey:operatorType:value:)](healthkit/hkquery/predicateforobjects(withmetadatakey:operatortype:value:).md)
- [predicateForObjectsWithNoCorrelation()](healthkit/hkquery/predicateforobjectswithnocorrelation().md)
