---
title: "removeAssets(at:)"
framework: photos
role: symbol
role_heading: Instance Method
path: "photos/phassetcollectionchangerequest/removeassets(at:)"
---

# removeAssets(at:)

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

## Declaration

```swift
func removeAssets(at indexes: IndexSet)
```

## Parameters

- `indexes`: The indexes of the assets to be removed from the asset collection.

## Discussion

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 removing assets. To remove objects based on their identities (without regard to their indexes in the collection), use the removeAssets(_:) method. note: Transient asset collections (such as those created with the transientAssetCollection(with:title:) method) do not support adding or removing content.

## See Also

### Modifying Asset Collections

- [init(for:)](photos/phassetcollectionchangerequest/init(for:).md)
- [init(for:assets:)](photos/phassetcollectionchangerequest/init(for:assets:).md)
- [title](photos/phassetcollectionchangerequest/title.md)
- [addAssets(_:)](photos/phassetcollectionchangerequest/addassets(_:).md)
- [insertAssets(_:at:)](photos/phassetcollectionchangerequest/insertassets(_:at:).md)
- [removeAssets(_:)](photos/phassetcollectionchangerequest/removeassets(_:).md)
- [replaceAssets(at:withAssets:)](photos/phassetcollectionchangerequest/replaceassets(at:withassets:).md)
- [moveAssets(at:to:)](photos/phassetcollectionchangerequest/moveassets(at:to:).md)
