Instance Property

isSuspended

A Boolean value indicating whether the queue is actively scheduling operations for execution.

Declaration

var isSuspended: Bool { get set }

Discussion

When the value of this property is false, the queue actively starts operations that are in the queue and ready to execute. Setting this property to true prevents the queue from starting any queued operations, but already executing operations continue to execute. You may continue to add operations to a queue that is suspended but those operations are not scheduled for execution until you change this property to false.

Operations are removed from the queue only when they finish executing. However, in order to finish executing, an operation must first be started. Because a suspended queue does not start any new operations, it does not remove any operations (including cancelled operations) that are currently queued and not executing.

You may monitor changes to the value of this property using Key-value observing. Configure an observer to monitor the isSuspended key path of the operation queue.

The default value of this property is false.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software