---
title: "ensureLocalAvailability(of:requireLatestVersion:)"
framework: backgroundassets
role: symbol
role_heading: Instance Method
path: "backgroundassets/assetpackmanager/ensurelocalavailability(of:requirelatestversion:)"
---

# ensureLocalAvailability(of:requireLatestVersion:)

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

## Declaration

```swift
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.

## Mentioned in

Reducing download and storage demands with localized asset packs

## Discussion

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 or statusUpdates(forAssetPackWithID:) in a separate task. To download multiple asset packs at the same time, use ensureLocalAvailability(of:requireLatestVersions:). note: When the system can’t ensure the asset pack’s local availability.

## See Also

### Managing asset packs

- [checkForUpdates()](backgroundassets/assetpackmanager/checkforupdates().md)
- [ensureLocalAvailability(of:requireLatestVersions:)](backgroundassets/assetpackmanager/ensurelocalavailability(of:requirelatestversions:).md)
- [assetPackIsAvailableLocally(withID:)](backgroundassets/assetpackmanager/assetpackisavailablelocally(withid:).md)
- [status(relativeTo:)](backgroundassets/assetpackmanager/status(relativeto:).md)
- [localStatus(ofAssetPackWithID:)](backgroundassets/assetpackmanager/localstatus(ofassetpackwithid:).md)
- [AssetPack.Status](backgroundassets/assetpack/status.md)
- [remove(assetPackWithID:)](backgroundassets/assetpackmanager/remove(assetpackwithid:).md)
- [status(ofAssetPackWithID:)](backgroundassets/assetpackmanager/status(ofassetpackwithid:).md)
- [ensureLocalAvailability(of:)](backgroundassets/assetpackmanager/ensurelocalavailability(of:).md)
