Does anyone know how to delete the last photo in the mobile phone album without calling the photo album or camera?
ringa_lee2017-05-02 09:35:20
Use Photos frames.
Get the assets collection first: [PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeImage options:]
,option 给一个按时间倒序排序的PHFetchOptions,这样得到的集合的第一个就是最后一张。然后调用 PHPhotoLibrary.sharedPhotoLibrary performChanges...
, 在block里执行 [PHAssetChangeRequest deleteAssets:]
That’s the idea, just write the code yourself. There are official examples of Photos Framework.