<!--
{
  "availability" : [
    "iOS: 9.0.0 - 27.0.0",
    "iPadOS: 9.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 2.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSBundleResourceRequest/beginAccessingResources(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBundleResourceRequest(im)beginAccessingResourcesWithCompletionHandler:"
  },
  "title" : "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.

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

## 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:

- error: Set to `nil` if the resources are downloaded successfully; otherwise this parameter holds an [`NSError`](/documentation/Foundation/NSError) object describing the problem that occurred. Errors are usually due to a lack of free space or problems connecting with the App Store.

## 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 ``doc://com.apple.foundation/documentation/Foundation/NSBundleResourceRequest/conditionallyBeginAccessingResources(completionHandler:)`` before accessing any resources marked with the tags managed by the request.

---

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)