Following predicate should fetch all the screenshots only, which work just fine.
options.predicate = [NSPredicate predicateWithFormat:@"(mediaSubtype & %d) != 0", PHAssetMediaSubtypePhotoScreenshot];
However if I try to exclude screenshots only by using follwing predicate, all of the images are excluded
options.predicate = [NSPredicate predicateWithFormat:@"(mediaSubtype & %d) = 0", PHAssetMediaSubtypePhotoScreenshot];
All Im trying to do is to exlude screeshots from asset fetch.
Is this known bug or am I missing something ?
I made a quick check and this seems to work for me:
PHFetchOptions *options = [[PHFetchOptions alloc] init];
options.predicate = [NSPredicate predicateWithFormat:@"(mediaSubtype & %d) == 0", PHAssetMediaSubtypePhotoScreenshot];
Note the double equal in the predicate to do the comparison instead of the single one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With