Instance Method


Cancels all queued and executing operations.


func cancelAllOperations()


This method calls the cancel() method on all operations currently in the queue.

Canceling the operations does not automatically remove them from the queue or stop those that are currently executing. For operations that are queued and waiting execution, the queue must still attempt to execute the operation before recognizing that it is canceled and moving it to the finished state. For operations that are already executing, the operation object itself must check for cancellation and stop what it is doing so that it can move to the finished state. In both cases, a finished (or canceled) operation is still given a chance to execute its completion block before it is removed from the queue.

See Also

Managing Operations in the Queue

func addOperation(Operation)

Adds the specified operation to the receiver.

func addOperations([Operation], waitUntilFinished: Bool)

Adds the specified operations to the queue.

func addOperation(() -> Void)

Wraps the specified block in an operation and adds it to the receiver.

var operations: [Operation]

The operations currently in the queue.

var operationCount: Int

The number of operations currently in the queue.

func waitUntilAllOperationsAreFinished()

Blocks the current thread until all of the receiver’s queued and executing operations finish executing.