Instance Property

isCancellable

Indicates whether the receiver is tracking work that can be cancelled.

Declaration

var isCancellable: Bool { get set }

Discussion

By default, NSProgress objects are cancellable.

You typically use this property to communicate whether controls for canceling should appear in a progress reporting user interface. NSProgress itself does not do anything with this property other than help pass the value from progress reporters to progress observers.

If an NSProgress is cancellable, you should implement the ability to cancel progress either by setting a block for the cancellationHandler property, or by polling the isCancelled property periodically while performing the relevant work.

It is valid for the value of this property to change during the lifetime of an NSProgress object. By default, NSProgress is KVO-compliant for this property, sending notifications on the same thread that updates the property.

See Also

Controlling Progress

var isCancelled: Bool

Indicates whether the receiver is tracking work that has been cancelled.

func cancel()

Cancel progress tracking.

var cancellationHandler: (() -> Void)?

The block to invoke when progress is cancelled.

var isPausable: Bool

Indicates whether the receiver is tracking work that can be paused.

var isPaused: Bool

Indicates whether the receiver is tracking work that has been paused.

func pause()

Pause progress tracking.

var pausingHandler: (() -> Void)?

The block to invoke when progress is paused.

func resume()

Resume progress tracking.

var resumingHandler: (() -> Void)?

The block to invoke when progress is resumed.

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