predicateForObjects(from:)
Returns a predicate that matches any objects that have been associated with the provided workout.
Declaration
class func predicateForObjects(from workout: HKWorkout) -> NSPredicateParameters
- workout:
The workout you are searching for.
Mentioned in
Return Value
A predicate that matches any objects that have been added to the provided workout.
Discussion
Use this convenience method to create a predicate that matches all the HealthKit objects for a given workout. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.
See Also
Related Documentation
Creating workout predicates
predicateForWorkouts(with:)predicateForWorkouts(activityPredicate:)predicateForWorkouts(with:duration:)predicateForWorkouts(operatorType:quantityType:averageQuantity:)predicateForWorkouts(operatorType:quantityType:maximumQuantity:)predicateForWorkouts(operatorType:quantityType:minimumQuantity:)predicateForWorkouts(operatorType:quantityType:sumQuantity:)predicateForWorkouts(with:totalDistance:)predicateForWorkouts(with:totalEnergyBurned:)predicateForWorkouts(with:totalFlightsClimbed:)predicateForWorkouts(with:totalSwimmingStrokeCount:)