current()
Returns the progress instance, if any.
Declaration
class func current() -> Progress?Return Value
The progress instance for the current thread, if any.
Discussion
If you invoke becomeCurrent(withPendingUnitCount:) on the current thread, this method returns the progress instance.
Use this per-thread current() value to allow code that performs work to report useful progress even when it’s widely separated from the code that actually presents progress information to the user, and without requiring layers of intervening code to pass around an Progress instance.
To ensure that you report progress in known units of work, you typically work with a suboperation progress object that you create by calling discreteProgress(totalUnitCount:).