As listed in documentation, PHAsset supports hidden (or isHidden)
fetch key. But when I'm trying to fetch hidden assets my app crashing with following log:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unsupported predicate in fetch options: hidden == 1'
Here is sample code:
PHFetchOptions *options = [[PHFetchOptions alloc] init];
options.wantsIncrementalChangeDetails = YES;
options.includeAllBurstAssets = YES;
options.includeHiddenAssets = YES;
options.predicate = [NSPredicate predicateWithFormat:@"hidden = YES"];
PHFetchResult *fetchResult = [PHAsset fetchAssetsWithOptions:options];
return fetchResult;
I did not read the question carefully in my first answer, perhaps this will help
If you only want the Hidden Albums why not use ? subtype:PHAssetCollectionSubtypeSmartAlbumAllHidden