<!--
{
  "availability" : [
    "iOS: 26.4.0 -",
    "iPadOS: 26.4.0 -",
    "macCatalyst: 26.4.0 -",
    "macOS: 26.4.0 -",
    "tvOS: 26.4.0 -",
    "visionOS: 26.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BackgroundAssets",
  "identifier" : "/documentation/BackgroundAssets/AssetPackManager/ensureLocalAvailability(of:requireLatestVersion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Background Assets"
    ],
    "preciseIdentifier" : "s:16BackgroundAssets16AssetPackManagerC23ensureLocalAvailability2of20requireLatestVersionyAA0cD0V_SbtYaKF"
  },
  "title" : "ensureLocalAvailability(of:requireLatestVersion:)"
}
-->

# ensureLocalAvailability(of:requireLatestVersion:)

Ensures that an asset pack is available locally, performing a download if necessary.

```
func ensureLocalAvailability(of assetPack: AssetPack, requireLatestVersion shouldUpdate: Bool = false) async throws
```

## Parameters

`assetPack`

The asset pack the local availability of which to ensure.

`shouldUpdate`

Whether to require that the latest version be available locally. When `true` is passed to this parameter, the method will wait for the update (if there indeed is one 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 pack is currently downloaded. If it isn’t, then the system schedules it to be downloaded and waits for the download to finish. If the method returns without throwing, the framework guarantees that the requested asset pack is now available locally. If the method throws, then the asset pack *isn’t* guaranteed to be available locally. 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.

To download multiple asset packs at the same time, use [`ensureLocalAvailability(of:requireLatestVersions:)`](/documentation/BackgroundAssets/AssetPackManager/ensureLocalAvailability(of:requireLatestVersions:)).

> Throws: When the system can’t ensure the asset pack’s local availability.

---

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)