Gated Operation

GatedOperation is similar to ComposedOperation except that it also accepts a () -> Bool block. If the block evaluates true, the composed operation will be executed.

This is useful to optionally execute an operation.

let operation = GatedOperation(anotherOperation) { return trueOrFalse() }
queue.addOperation(operation)

Did this page help you?