---
title: "withExclusiveControl(_:)"
framework: Background Assets
role: symbol
role_heading: Instance Method
platforms: [iOS 16.1+, iPadOS 16.1+, Mac Catalyst 16.1+, macOS 13.0+, tvOS 18.4+, visionOS 2.4+]
path: "backgroundassets/badownloadmanager/withexclusivecontrol(_:)-2ang9"
---

# withExclusiveControl(_:)

## Declaration

```swift
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

Discussion Acquires exclusive access to the BADownloadManager across the app and application extension. 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.
