predicateForObjects(from:)
Returns a predicate that matches all the objects that were created by the provided source.
Declaration
class func predicateForObjects(from source: HKSource) -> NSPredicateParameters
- 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
A predicate that matches all the objects created by the provided source.
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
Creating object predicates
predicateForObject(with:)predicateForObjects(with:)predicateForObjects(from:)predicateForObjects(from:)predicateForObjects(withDeviceProperty:allowedValues:)predicateForObjects(from:)predicateForObjects(withMetadataKey:)predicateForObjects(withMetadataKey:allowedValues:)predicateForObjects(withMetadataKey:operatorType:value:)predicateForObjectsWithNoCorrelation()