deleteCollectionLists(_:)

deleteCollectionLists(_:)

deleteCollectionLists(_:) Type Method of PHCollectionListChangeRequest Requests to delete the specified asset collections.

class func deleteCollectionLists(_ collectionLists: any NSFastEnumeration)

Parameters

collectionLists

An array of PHCollectionList objects to be deleted.

Discussion

Call this method within a photo library change block to delete collection lists. For details on change blocks, see PHPhotoLibrary.

Important: Deleting a collection list also deletes any child collections it contains. To preserve those collections, remove them from the collection list (with the `doc://com.apple.photokit/documentation/Photos/PHCollectionListChangeRequest/removeChildCollections(_:) or doc://com.apple.photokit/documentation/Photos/PHCollectionListChangeRequest/removeChildCollections(at:)` method) before deleting it. Deleting a collection list does not delete assets contained in its child collections.