<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Progress/discreteProgress(totalUnitCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSProgress(cm)discreteProgressWithTotalUnitCount:"
  },
  "title" : "discreteProgress(totalUnitCount:)"
}
-->

# discreteProgress(totalUnitCount:)

Creates and returns a progress instance with the specified unit count that isn’t part of any existing progress tree.

```
class func discreteProgress(totalUnitCount unitCount: Int64) -> Progress
```

## Parameters

`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 `Progress/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 <doc://com.apple.documentation/documentation/Dispatch/dispatch_async>. In that block, you can invoke methods like [`becomeCurrent(withPendingUnitCount:)`](/documentation/Foundation/Progress/becomeCurrent(withPendingUnitCount:)) or [`resignCurrent()`](/documentation/Foundation/Progress/resignCurrent()), and set the [`completedUnitCount`](/documentation/Foundation/Progress/completedUnitCount) or [`isCancelled`](/documentation/Foundation/Progress/isCancelled) properties as your app finishes its work.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)