<!--
{
  "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/AssetPackManager/ensureLocalAvailability(of:requireLatestVersions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Background Assets"
    ],
    "preciseIdentifier" : "s:16BackgroundAssets16AssetPackManagerC23ensureLocalAvailability2of21requireLatestVersionsyShyAA0cD0VG_SbtYaKF"
  },
  "title" : "ensureLocalAvailability(of:requireLatestVersions:)"
}
-->

# ensureLocalAvailability(of:requireLatestVersions:)

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

```
func ensureLocalAvailability(of assetPacks: Set<AssetPack>, requireLatestVersions shouldUpdate: Bool = false) async throws
```

## 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 `true` is passed to this parameter, the method will wait for the updates (if there indeed are any available) to be downloaded before returning. When `false` is passed, the method won’t check for updates and won’t attempt to download any.

## Discussion

This method checks whether the asset packs are currently downloaded. If any aren’t, then the system schedules them to be downloaded and waits for all of the downloads to finish. The framework guarantees that the requested asset packs are available locally after this method returns without throwing. If the method throws, then the asset packs *aren’t* all guaranteed to be available locally, though some might be; inspect the thrown error for more details. You can optionally monitor download progress by awaiting status updates from [`statusUpdates`](/documentation/BackgroundAssets/AssetPackManager/statusUpdates) or [`statusUpdates(forAssetPackWithID:)`](/documentation/BackgroundAssets/AssetPackManager/statusUpdates(forAssetPackWithID:)) in a separate task.

> Throws: When the system can’t ensure one or more asset packs’ local availability. When the thrown error is an instance of ``doc://com.apple.backgroundassets/documentation/BackgroundAssets/AssetPackManager/LocalAvailabilityError``, it provides information about asset packs for which the system successfully ensured local availability and those for which the system couldn’t ensure local availability, with an underlying error for each failure.

---

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)