addAssetsGroupAlbum(withName:resultBlock:failureBlock:)
Adds a new assets group to the library.
Declaration
func addAssetsGroupAlbum(withName name: String!, resultBlock: ALAssetsLibraryGroupResultBlock!, failureBlock: ALAssetsLibraryAccessFailureBlock!)Parameters
- name:
The name for the new group.
If
nameconflicts with another assets group with the same name, then the group is not created andresultBlockreturns anilgroup. - resultBlock:
The block invoked after the add operation completes.
For a description of the block, see Alassetslibraryaccessfailureblock.
- failureBlock:
The block to invoke if the add operation fails—for example, if the user denies access to the application.
For a description of the block, see Alassetsgroupfaces.
Discussion
The name of the new asset group is name, its type is ALAssetsGroupAlbum, and the isEditable property is true.
This method is asynchronous. When the assets group is added, the user may be asked to confirm the application’s access to the data; the method, though, returns immediately. You should perform whatever work you want with the group in resultBlock.
If the user denies access to the application, or if no application is allowed to access the data, or if the data is currently unavailable, the failure block is called.