<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BackgroundAssets",
  "identifier" : "/documentation/BackgroundAssets/BAAssetPackManager/ensureLocalAvailabilityOfAssetPacks:requireLatestVersions:completionHandler:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Background Assets"
    ],
    "preciseIdentifier" : "c:objc(cs)BAAssetPackManager(im)ensureLocalAvailabilityOfAssetPacks:requireLatestVersions:completionHandler:"
  },
  "title" : "ensureLocalAvailabilityOfAssetPacks:requireLatestVersions:completionHandler:"
}
-->

# ensureLocalAvailabilityOfAssetPacks:requireLatestVersions:completionHandler:

Ensures that the specified asset packs are available locally, performing a batch download if necessary.

```
- (void) ensureLocalAvailabilityOfAssetPacks:(NSSet<BAAssetPack *> *) assetPacks requireLatestVersions:(BOOL) shouldUpdate completionHandler:(void (^)(NSError *error)) completionHandler;
```

## Parameters

`assetPacks`

The asset packs the local availability of which to ensure.

`shouldUpdate`

Whether to require that the respective latest versions be available locally. When `YES` is passed to this parameter, the method will wait for the updates (if there indeed are any available) to be downloaded before returning. When `NO` is passed, the method won’t check for updates and won’t attempt to download any.

`completionHandler`

A block that’s called when the asset packs are all available locally or that receives an error if one occurs.

## Discussion

This method checks whether the asset packs are currently downloaded. If any aren’t, then the system schedules them to be downloaded and calls the completion handler with `nil` for the completion handler’s `error` parameter when all of the downloads finish. The framework guarantees that the requested asset packs are available locally after this method calls the completion handler with `nil` for the `error` parameter. If this method calls the completion handler with a non-`nil` value for `error`, then the asset packs *aren’t* all guaranteed to be available locally. You can optionally monitor download progress by attaching a delegate object to [`delegate`](/documentation/BackgroundAssets/BAAssetPackManager/delegate).

---

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)