Instance Method

insertAssets:atIndexes:

Inserts the specified assets into the collection at the specified indexes.

Declaration

- (void)insertAssets:(id<NSFastEnumeration>)assets atIndexes:(NSIndexSet *)indexes;

Parameters

assets

An array of PHAsset objects to be inserted into the asset collection.

indexes

The indexes at which the assets should be inserted. The count of locations in this index set must equal the count of assets.

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 changeRequestForAssetCollection:assets: method before inserting assets.

For a detailed discussion of how the index set you specify maps to insertions in the list of assets, see the similar NSMutableArray method insertObjects:atIndexes:.

See Also

Modifying Asset Collections

+ changeRequestForAssetCollection:

Creates a request for modifying the specified asset collection.

+ changeRequestForAssetCollection:assets:

Creates a request for modifying the specified asset collection, with a fetch result for tracking changes.

title

The displayed name of the asset collection.

- addAssets:

Add the specified assets to the asset collection.

- removeAssets:

Removes the specified assets from the asset collection.

- removeAssetsAtIndexes:

Removes the assets at the specified indexes from the asset collection.

- replaceAssetsAtIndexes:withAssets:

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

- moveAssetsAtIndexes:toIndex:

Moves the assets at the specified indexes in the asset collection to a new index.