AnyPredicate

public struct AnyPredicate<T> : Predicate

A type-erased Predicate.

  • A type that provides information about what kind of values the predicate can be evaluated with.

    Declaration

    Swift

    public typealias InputType = T
  • Creates a type-erased Predicate that wraps the given instance.

    Declaration

    Swift

    public init<P>(_ predicate: P) where T == P.InputType, P : Predicate
  • Returns a Boolean value that indicates whether a given input matches the conditions specified by the receiver.

    Declaration

    Swift

    public func evaluate(with input: InputType) -> Bool

    Parameters

    input

    The input against which to evaluate the receiver.

    Return Value

    true if input matches the conditions specified by the receiver, false otherwise.