ALAssetsLibrary
An instance of ALAssetsLibrary provides access to the videos and photos that are under the control of the Photos application.
Declaration
class ALAssetsLibraryOverview
The library includes those that are in the Saved Photos album, those coming from iTunes, and those that were directly imported into the device. You use it to retrieve the list of all asset groups and to save images and videos into the Saved Photos album.
You create an instance of ALAssetsLibrary using alloc and init:
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];The lifetimes of objects you get back from a library instance are tied to the lifetime of the library instance.
Many of the methods declared by ALAssetsLibrary take blocks for failure and success as arguments. These methods are all asynchronous because the user may need to be asked to grant access to the data.
Topics
Accessing Assets
Managing Notifications
Finding Assets
Enumerating Assets
Saving Assets
writeVideoAtPath(toSavedPhotosAlbum:completionBlock:)videoAtPathIs(compatibleWithSavedPhotosAlbum:)writeImage(toSavedPhotosAlbum:orientation:completionBlock:)writeImageData(toSavedPhotosAlbum:metadata:completionBlock:)writeImage(toSavedPhotosAlbum:metadata:completionBlock:)
Managing Asset Groups
Constants
ALAssetsGroupTypeTypes of AssetALAssetOrientationALAssetsLibraryGroupsEnumerationResultsBlockALAssetsLibraryAssetForURLResultBlockALAssetsLibraryWriteImageCompletionBlockALAssetsLibraryWriteVideoCompletionBlockALAssetsLibraryAccessFailureBlockALAssetsLibraryGroupResultBlockALAuthorizationStatusNotification KeysError DomainError Codes