1

Right now I use that to exclude Screenshots:

let options = PHFetchOptions()
options.predicate = NSPredicate(format: "NOT (mediaSubtype & \(PHAssetMediaSubtype.photoScreenshot.rawValue) != 0)")
var fetchResult: PHFetchResult<PHAsset> = fetchResult = 
PHAsset.fetchAssets(with: PHAssetMediaType.image, options: options)

But I want to include only photos that were taken from iPhone Camera (not photos that were saved from other applications like Skype and so on). Is it possible?

Paul T.
  • 4,938
  • 7
  • 45
  • 93
  • I hope this will help you, please follow this link: https://stackoverflow.com/questions/32169185/how-to-fetch-all-images-from-custom-photo-album-swift – Sagar Chauhan Mar 27 '18 at 07:37
  • 1
    @PaulMarshal , thanks I didn't know that I can filter by album name, but that doesn't solve the issue how to extract photos that I took on camera (that were not saved from other applications) – Paul T. Mar 27 '18 at 09:41
  • https://github.com/alexanderkent/PHAsset-Meta try filtering images with meta data – Abhishek Master Mar 27 '18 at 10:16
  • @AbhishekMaster , thanks, that was exactly what I did – Paul T. Feb 07 '19 at 12:49
  • @PaulT. so you fetch all photos and then filter using the metadata? I tried that, but that was very slow (I have > 30k photos) Is there no other way to filter out certain albums? – Georg Feb 20 '23 at 10:48

0 Answers0