class func current() -> Progress?
func becomeCurrent (withPendingUnitCount : Int64)
func addChild (Progress, withPendingUnitCount : Int64)
func resignCurrent ()
Availability 有効性
Technology
func performAsCurrent<ReturnType >(withPendingUnitCount unitCount: Int64
, using work: () throws -> ReturnType ) rethrows -> ReturnType
unitCount
The number of units of work to increment for the current progress object. This number represents the portion of work that is complete in relation to the total number of units of work for the current thread’s progress object. The units of work for this parameter must be the same units of work as the current progress object’s total
property.
work
A block that wraps the work you specify to complete for incrementing the current progress.
The return type and value of the block that you specify for the work
parameter.
Use this function as a convenience method to wrap an existing method or block to increment the current progress object. This function retrieves the current progress object, does the work you specify in the work block, and returns the value from that block. When the block is complete, this function increments the current progress object. This function is the same as calling become
, doing the work you specify in the block, and calling resign
.
class func current() -> Progress?
func becomeCurrent (withPendingUnitCount : Int64)
func addChild (Progress, withPendingUnitCount : Int64)
func resignCurrent ()