Contents

ensureLocalAvailabilityOfAssetPack:completionHandler:

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

Declaration

- (void) ensureLocalAvailabilityOfAssetPack:(BAAssetPack *) assetPack completionHandler:(void (^)(NSError *error)) completionHandler;

Parameters

  • assetPack:

    The asset pack the local availability of which to ensure.

  • completionHandler:

    A block that’s called when the asset pack is available locally or that receives an error if one occurs.

Mentioned in

Discussion

This method checks whether the asset pack is currently downloaded. If it isn’t, then the system schedules it to be downloaded and calls the completion handler with nil for the the completion handler’s error parameter when the download finishes. The framework guarantees that the requested asset pack is 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 pack isn’t guaranteed to be available locally. You can optionally monitor download progress by attaching a delegate object to delegate.

To download multiple asset packs at the same time, use ensureLocalAvailabilityOfAssetPacks:completionHandler:.

See Also

Managing asset packs