Contents

predicateForWorkouts(with:)

Returns a predicate for matching workouts based on the type of activity.

Declaration

class func predicateForWorkouts(with workoutActivityType: HKWorkoutActivityType) -> NSPredicate

Parameters

  • 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