Delete an asset (picture or video) from IPhone in IOS

Paul A. picture Paul A. · Aug 26, 2012 · Viewed 11.4k times · Source

I am working on an Iphone app and I can enumerate assets using the Assetslibrary and load them into a table view. The user can delete a row (a picture / video) in the app but how do I UPDATE the Iphone photo album directly from my app? Otherwise on refreshing, the tableview will reload the previously deleted asset.

Answer

Ted picture Ted · Jun 23, 2014

in ios8 deleting photos is possible using the Photos Framework

Please check the documentation of Photos Framework

For deleting assets refer to PHAssetChangeRequest

+ (void)deleteAssets:(id<NSFastEnumeration>)assets

where assets is an array of PHAsset objects to be deleted.

+

For deleting collections refer to PHAssetCollectionChangeRequest

+ (void)deleteAssetCollections:(id<NSFastEnumeration>)assetCollections

https://developer.apple.com/documentation/photos/phassetchangerequest/1624062-deleteassets
https://developer.apple.com/documentation/photos/phassetcollectionchangerequest/1619453-deleteassetcollections