AsyncPredicate
public protocol AsyncPredicate
The AsyncPredicate
protocol defines the structure that must be implemented by concrete async predicates.
-
A type that provides information about what kind of values the predicate can be evaluated with.
Declaration
Swift
associatedtype InputType
-
Asynchronous evaluates whether a given input matches the conditions specified by the receiver, then calls a handler upon completion.
Declaration
Swift
func evaluate(with input: InputType, queue: DispatchQueue, completionHandler: @escaping (_ matches: Bool) -> Void)
Parameters
input
The input against which to evaluate the receiver.
queue
The queue on which the completion handler is executed.
completionHandler
The completion handler to call when the evaluation is complete. It takes a
Bool
parameter:matches
true
if input matches the conditions specified by the receiver,false
otherwise.