Class

ALAssetsGroup

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.

Overview

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.

Symbols

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!)

Adds an existing asset to the receiver.

var isEditable: Bool

Indicates whether the application can edit the group.

Filtering

func numberOfAssets()

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!)

Returns the group’s value for a given property.

func posterImage()

Returns the group’s poster image

Constants

ALAssetsGroupEnumerationResultsBlock

Signature for the block executed during enumeration of assets.

Group Property Names

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

Relationships

Inherits From

Conforms To