How do I determine if a PHAsset in a PHFetchResult represents a deleted photo?

前端 未结 3 1129
长情又很酷
长情又很酷 2020-12-29 11:14

I\'m trying to grab a thumbnail of the last photo taken on a device using the new Photos framework in iOS 8. The code I have right now to do this is the following:



        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 12:01

    PHFetchResult * recentlyDeletedAlbum = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:1000000201 options:nil];
    

    This returns collection of all recently deleted assets. You can iterate and get PHAsset for all objects in this collection to check if your PHAsset was deleted or not.

提交回复
热议问题