predicateForWorkouts(with:totalEnergyBurned:)
Returns a predicate for matching workouts based on the total energy burned.
Declaration
class func predicateForWorkouts(with operatorType: NSComparisonPredicate.Operator, totalEnergyBurned: HKQuantity) -> NSPredicateParameters
- operatorType:
The operator type to use when comparing the total energy burned.
- totalEnergyBurned:
The target amount of energy burned.
Return Value
A predicate for matching workouts based on the total energy burned. This predicate works only on workouts.
Discussion
Use this convenience method to create a predicate that matches against a workout’s total energy burned. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.
See Also
Related Documentation
Creating workout predicates
predicateForObjects(from:)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:totalFlightsClimbed:)predicateForWorkouts(with:totalSwimmingStrokeCount:)