<!--
{
  "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/conditionallyBeginAccessingResources(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBundleResourceRequest(im)conditionallyBeginAccessingResourcesWithCompletionHandler:"
  },
  "title" : "conditionallyBeginAccessingResources(completionHandler:)"
}
-->

# conditionallyBeginAccessingResources(completionHandler:)

Checks whether the resources marked with the tags managed by the request are already on the device. If all of the resources are on the device, you can begin accessing those resources.

```
func conditionallyBeginAccessingResources(completionHandler: @escaping @Sendable (Bool) -> Void)
```

## Parameters

`completionHandler`

A block called when the availability of the resources has been checked.

    The block takes the following parameter:

- resourcesAvailable: Returns <doc://com.apple.documentation/documentation/Swift/true> if all of the resources marked with the tags managed by the request are already on the device. Returns <doc://com.apple.documentation/documentation/Swift/false> if any of the resources are not on the device.

## Discussion

If the resources marked with the tags managed by the request are already on the device, you can start accessing them as soon as the completion handler is called with `resourcesAvailable` set to <doc://com.apple.documentation/documentation/Swift/true>. If all of the resources are not already available, you need to call [`beginAccessingResources(completionHandler:)`](/documentation/Foundation/NSBundleResourceRequest/beginAccessingResources(completionHandler:)) to download them from the App Store.

> Important:
> If `resourcesAvailable` is <doc://com.apple.documentation/documentation/Swift/true>, do not call ``doc://com.apple.foundation/documentation/Foundation/NSBundleResourceRequest/beginAccessingResources(completionHandler:)``. You must call this method or ``doc://com.apple.foundation/documentation/Foundation/NSBundleResourceRequest/beginAccessingResources(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)