An ALAssetsGroup object represents an ordered set of the assets managed by the Photos application. The order of the elements is the same as the user sees in the Photos application. An asset can belong to multiple assets groups.


class ALAssetsGroup : NSObject


Assets groups themselves are synced via iTunes, created to hold the user’s saved photos or created during camera import. You can indirectly modify the Saved Photos group by saving images or videos into it using the ALAssetsLibrary class.


Enumerating Assets

func enumerateAssets(ALAssetsGroupEnumerationResultsBlock!)

Invokes a given block using each of the assets in the group.

func enumerateAssets(at: IndexSet!, options: NSEnumerationOptions, using: ALAssetsGroupEnumerationResultsBlock!)

Invokes a given block using each of the assets in the group at specified indexes.

Adding Assets

func add(ALAsset!) -> Bool

Adds an existing asset to the receiver.

var isEditable: Bool

Indicates whether the application can edit the group.


func numberOfAssets() -> Int

Returns the number of assets in the group that match the current filter.

func setAssetsFilter(ALAssetsFilter!)

Sets the filter for the group.

Accessing Properties

func value(forProperty: String!) -> Any!

Returns the group’s value for a given property.

func posterImage() -> Unmanaged<CGImage>!

Returns the group’s poster image


typealias ALAssetsGroupEnumerationResultsBlock

Signature for the block executed during enumeration of assets.

Group Property Names

Constants for the names of group properties, used by value(forProperty:).


Inherits From

Conforms To