Instance Property

isPausable

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

Declaration

var isPausable: Bool { get set }

Discussion

By default, NSProgress objects are not pausable.

You typically use this property to communicate whether controls for pausing 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 pausable, you should implement the ability to pause either by setting a block for the pausingHandler property, or by polling the isPaused 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 isCancellable: Bool

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

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 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.