discreteProgress(totalUnitCount:)
Creates and returns a progress instance with the specified unit count that isn’t part of any existing progress tree.
Declaration
class func discreteProgress(totalUnitCount unitCount: Int64) -> ProgressParameters
- unitCount:
The total number of units of work to assign to the progress instance.
Return Value
A new progress instance with its containing progress object set to nil.
Discussion
Use this method to create the top-level progress object that your custom classes return. The receiver of the returned progress object can add it to a progress tree using addChild(_:withPendingUnitCount:).
You’re responsible for updating the progress count of the created progress object. You can invoke this method on one thread and then message the returned NSProgress on another thread. For example, you can capture the created progress instance in a block that you pass to dispatch_async. In that block, you can invoke methods like becomeCurrent(withPendingUnitCount:) or resignCurrent(), and set the completedUnitCount or isCancelled properties as your app finishes its work.