Instance Method

addOperation(_:)

Adds the specified operation to the receiver.

Declaration

func addOperation(_ op: Operation)

Parameters

operation

The operation to be added to the queue.

Discussion

Once added, the specified operation remains in the queue until it finishes executing.

See Also

Managing Operations in the Queue

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.

Deprecated
var operationCount: Int

The number of operations currently in the queue.

Deprecated
func cancelAllOperations()

Cancels all queued and executing operations.

func waitUntilAllOperationsAreFinished()

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