Contents

predicateForObject(with:)

Returns a predicate that matches an object with the specified universally unique identifier (UUID).

Declaration

class func predicateForObject(with UUID: UUID) -> NSPredicate

Parameters

  • UUID:

    The target UUID.

Return Value

A predicate that matches a specific object based on its UUID.

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 matches the object with the provided UUID. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.

See Also

Related Documentation

Creating object predicates