Contents

asset(for:resultBlock:failureBlock:)

Invokes a given block passing as a parameter an asset identified by a specified file URL.

Declaration

func asset(for assetURL: URL!, resultBlock: ALAssetsLibraryAssetForURLResultBlock!, failureBlock: ALAssetsLibraryAccessFailureBlock!)

Parameters

Discussion

This method is asynchronous. When the asset is requested, the user may be asked to confirm the application’s access to the library; the method, though, returns immediately. You should perform whatever work you want with the asset in resultBlock.

If the user denies access to the application, or if no application is allowed to access the data, the failure block is called.