Contents

replaceAssets(at:withAssets:)

Replaces the assets at the specified indexes in the asset collection with the specified assets.

Declaration

func replaceAssets(at indexes: IndexSet, withAssets assets: any NSFastEnumeration)

Parameters

  • indexes:

    The indexes of the assets to be replaced in the asset collection.

  • assets:

    An array of Phasset objects to be inserted into (or moved within) the asset collection.

Discussion

To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the init(for:assets:) method before rearranging assets.

See Also

Modifying Asset Collections