Contents

predicateForObjects(from:)

Returns a predicate that matches all the objects that were created by any of the provided sources.

Declaration

class func predicateForObjects(from sources: Set<HKSource>) -> NSPredicate

Parameters

  • sources:

    A set of sources that have saved data to the HealthKit store.

Return Value

A predicate that matches all the objects created by any of the provided sources.

Discussion

Use this convenience method to create a predicate that finds all the objects from a specified set of apps or devices. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.

See Also

Related Documentation

Creating object predicates