<!--
{
  "availability" : [
    "iOS: 16.1.0 - 27.0.0",
    "iPadOS: 16.1.0 - 27.0.0",
    "macCatalyst: 16.1.0 - 27.0.0",
    "macOS: 13.0.0 - 27.0.0",
    "tvOS: 18.4.0 - 27.0.0",
    "visionOS: 2.4.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "BackgroundAssets",
  "identifier" : "/documentation/BackgroundAssets/BADownloadManager/withExclusiveControl(_:)-2ang9",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Background Assets"
    ],
    "preciseIdentifier" : "c:objc(cs)BADownloadManager(im)performWithExclusiveControl:"
  },
  "title" : "withExclusiveControl(_:)"
}
-->

# withExclusiveControl(_:)

```
func withExclusiveControl(_ performHandler: @escaping (Bool, (any Error)?) -> Void)
```

## Parameters

`performHandler`

A block that will be executed once exclusive control is acquired.
If an error is non-nil then a problem occurred acquiring exclusive access.

## Discussion\abstract Acquires exclusive access to the BADownloadManager across the app and application extension.
\discussion Acquires exclusive access to the BADownloadManager across the app and application extension. This ensures that your extension and app
do not perform operations at the same time. Both the extension and app must use this API to ensure exclusive access.

---

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)