Type Method

current()

Returns the NSProgress instance, if any, associated with the current thread by a previous invocation of becomeCurrent(withPendingUnitCount:).

Declaration

class func current() -> Progress?

Return Value

The NSProgress instance associated with the current thread, if any.

Discussion

Use this per-thread currentProgress value to allow code that performs work to report useful progress even when it is widely separated from the code that actually presents progress information to the user, without requiring layers of intervening code to pass around an NSProgress instance.

When reporting progress, you typically work with a child progress object, created by calling discreteProgress(totalUnitCount:), to ensure that you report progress in known units of work.

See Also

Current Progress Object

func becomeCurrent(withPendingUnitCount: Int64)

Sets the receiver as the current progress object of the current thread and specifies the portion of work to be performed by the next child progress object of the receiver.

func addChild(Progress, withPendingUnitCount: Int64)

Add a process object as a child of a progress tree. The inUnitCount indicates the expected work for the progress unit.

func resignCurrent()

Balance the most recent previous invocation of becomeCurrent(withPendingUnitCount:) on the same thread by restoring the current progress object to what it was before becomeCurrent(withPendingUnitCount:) was invoked.