Instance Method


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


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



An asset URL previously retrieved from an ALAsset object.


The block to invoke using the asset identified by assetURL.

For a description of the block, see ALAssetsLibraryAssetForURLResultBlock.


The block to invoke if the user denies access to the assets library.

For a description of the block, see ALAssetsLibraryAccessFailureBlock.


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.