I am trying to use the includeAllBurstAssets of PHFetchOptions. In my camera roll, there are about 5 burst assets (each with about 10 photos).
To enumerate the assets in the Camera Roll I'm doing the following:
PHFetchOptions *fetchOptions = [PHFetchOptions new];
fetchOptions.includeAllBurstAssets = YES;
PHFetchResult *fetchResult = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:fetchOptions];
PHFetchResult *assetFetch = [PHAsset fetchAssetsInAssetCollection:fetchResult[0] options:fetchOptions];
NSLog(@"Found assets %lu",(unsigned long)assetFetch.count);
No matter, if I set the includeAllBurstAssets property to NO or YES, I get the exact same count of assets. I expected the number to be higher, if includeAllBurstAssets is set to YES. Is this a bug or I am interpreting the includeAllBurstAssets in a wrong way.
There is a special method to query for all images of a burst sequence.
In your case you need to iterate over your assetFetch object and check if the PHAsset represents a burst.
PHAsset
defines the propertyBOOL representsBurst
If that returns
YES
, fetch all assets for that burst sequence.Here is a code snippet that might help to understand:
As you can see, the burstSelectionTypes are not always set resp. are sometimes PHAssetBurstSelectionTypeNone for all assets of a burst sequence.