---
title: "beginAccessingResources(completionHandler:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsbundleresourcerequest/beginaccessingresources(completionhandler:)"
---

# beginAccessingResources(completionHandler:)

Requests access to the resources marked with the managed tags. If any of the resources are not on the device, they are requested from the App Store.

## Declaration

```swift
func beginAccessingResources(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func beginAccessingResources() async throws
```

## Parameters

- `completionHandler`: A block called when the resources have finished downloading or if an error occurs. The resources are not available until the completion handler is called with error set to nil. The block takes the following parameter:

## Discussion

Discussion After calling this method, the resource request downloads any on-demand resources not already on the device. When all the resources are downloaded, they are marked as non-purgeable. The resources are not available to the app until the completion handler is called with no error. important: You must call this method or conditionallyBeginAccessingResources(completionHandler:) before accessing any resources marked with the tags managed by the request.

## See Also

### Requesting resources

- [conditionallyBeginAccessingResources(completionHandler:)](foundation/nsbundleresourcerequest/conditionallybeginaccessingresources(completionhandler:).md)
- [endAccessingResources()](foundation/nsbundleresourcerequest/endaccessingresources().md)
