predicateForWorkouts(with:)
Returns a predicate for matching workouts based on the type of activity.
Declaration
class func predicateForWorkouts(with workoutActivityType: HKWorkoutActivityType) -> NSPredicateParameters
- workoutActivityType:
The type of activity. For a list of valid workout activities, see Hkworkoutactivitytype.
Return Value
A predicate for matching workouts based on the type of activity.
Discussion
Use this convenience method to create a predicate that matches workouts based on their activity. 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(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:)