Contents

predicateForWorkouts(with:duration:)

Returns a predicate for matching workouts based on their duration.

Declaration

class func predicateForWorkouts(with operatorType: NSComparisonPredicate.Operator, duration: TimeInterval) -> NSPredicate

Parameters

  • operatorType:

    The operator type to use when comparing the duration.

  • duration:

    The target duration.

Return Value

A predicate for matching workouts based on their duration. This predicate works only on workouts.

Discussion

Use this convenience method to create a predicate that matches against a workout’s duration. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.

See Also

Related Documentation

Creating workout predicates