There is a subtype of the recently added collection: PHAssetCollectionSubtypeSmartAlbumRecentlyAdded
. However, there is no assetCollectionSubtype
that identifies the Recently Deleted collection.
This is the description of the Recently Deleted collection in my case: (iOS 8.1.3): DF876BFD-...-C97F4628467C/L0/040 Recently Deleted assetCollectionType=2/1000000201
This indicates the type PHAssetCollectionTypeSmartAlbum
. But what is the subtype of 1000000201
?
201
must comply with PHAssetCollectionSubtypeSmartAlbumPanoramas
according to the docs.
Can you trust the magic number 1000000201
so that it never changes? Probably not.
However, you can get a recently deleted collection:
PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:1000000201 options:nil];
There is a big difference in this particular smart album: PHAsset
cannot be deleted (again) because it is garbage. Therefore, it would be important to know if the user should offer a deletion option.
Does anyone have any ideas?
source share