Instance Property

burstSelectionTypes

The selection type of the asset in a burst photo sequence.

Declaration

var burstSelectionTypes: PHAssetBurstSelectionType { get }

Discussion

When the user takes a sequence of photos in burst mode with the Camera app (on supported devices), the Photos app user interface groups the resulting assets together and allows the user to select favorite members of the sequence. Photos also automatically marks members of the sequence as potential user favorites. See PHAssetBurstSelectionType for possible values.

Because an asset may have more than one selection type, you use bit masks to identify an asset. For example, the code below tests an asset’s selection type:

if (asset.burstSelectionTypes & (PHAssetBurstSelectionTypeAutoPick | PHAssetBurstSelectionTypeUserPick)) {
    // display two badges in UI
} else if (asset.burstSelectionTypes & PHAssetBurstSelectionTypeAutoPick)) {
    // display auto-selected badge in UI
} else if (asset.burstSelectionTypes & PHAssetBurstSelectionTypeUserPick)) {
    // display user-selected badge in UI
}

See Also

Working with Burst Photo Assets

var burstIdentifier: String?

The unique identifier shared by photo assets from the same burst sequence.

struct PHAssetBurstSelectionType

Bit mask values indicating whether and how an asset is marked as a favorite member of a burst photo sequence. Used by the burstSelectionTypes property.

var representsBurst: Bool

A Boolean value that indicates whether the asset is the representative photo from a burst photo sequence.