<!--
{
  "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/init(totalUnitCount:parent:pendingUnitCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSProgress(cm)progressWithTotalUnitCount:parent:pendingUnitCount:"
  },
  "title" : "init(totalUnitCount:parent:pendingUnitCount:)"
}
-->

# init(totalUnitCount:parent:pendingUnitCount:)

Creates a progress instance for the specified progress object with a unit count that’s a portion of the containing object’s total unit count.

```
init(totalUnitCount unitCount: Int64, parent: Progress, pendingUnitCount portionOfParentTotalUnitCount: Int64)
```

## Parameters

`unitCount`

The total number of units of work to assign to the progress instance.

`parent`

The containing progress object for the created [`Progress`](/documentation/Foundation/Progress) object.

`portionOfParentTotalUnitCount`

The unit count for the progress object.

## Discussion

Use this method to initialize a progress object with a specified containing progress object and unit count.

In many cases, you can precede code that does a substantial amount of work with an invocation of this method, then repeatedly set the [`completedUnitCount`](/documentation/Foundation/Progress/completedUnitCount) or [`isCancelled`](/documentation/Foundation/Progress/isCancelled) property in the loop that does the work.

You can invoke this method on one thread and then message the returned [`Progress`](/documentation/Foundation/Progress) 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)