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

# predicateForObjects(from:)

Returns a predicate that matches all the objects that were created by the provided source.

## Declaration

```swift
class func predicateForObjects(from source: HKSource) -> NSPredicate
```

## Parameters

- `source`: The source that saved data into the HealthKit store. The source object represents either an app or a devices capable of saving data directly into the HealthKit store (for example, a linked Bluetooth heart rate monitor).

## Return Value

Return Value A predicate that matches all the objects created by the provided source.

## Discussion

Discussion Use this convenience method to create a predicate that finds all the objects from a specific app or device. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.

## See Also

### Related Documentation

- [source](healthkit/hkobject/source.md)
- [HKSourceQuery](healthkit/hksourcequery.md)

### Creating object predicates

- [predicateForObject(with:)](healthkit/hkquery/predicateforobject(with:).md)
- [predicateForObjects(with:)](healthkit/hkquery/predicateforobjects(with:).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)
