1

Is there a way to get all PNG files from the user's photo library? I don't believe it's possible to set query constraints on UIImagePickerController.

Is there anything I can do with the Photos framework? I've been looking into using PFFetch, but I can't seem to figure out if it will do what I need.

swiftyboi
  • 2,965
  • 4
  • 25
  • 52
  • Possible duplicate of: https://stackoverflow.com/questions/38059953/how-to-fetch-all-photos-from-library?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Pranav Kasetti May 15 '18 at 15:14
  • It's not a duplicate of the question you linked. I know how to fetch the user's photo library - the distinction is that I want to fetch ONLY photos of the PNG type from the photo library. – swiftyboi May 15 '18 at 15:18
  • 1
    You can add a filter with the same logic described in answer 2 here: https://stackoverflow.com/a/37833566/4995828 – Pranav Kasetti May 15 '18 at 15:25
  • 2
    Otherwise I checked and it seems you need to filter by uniform type identifier (https://developer.apple.com/documentation/photos/phcontenteditinginput/1518675-uniformtypeidentifier) - namely for kUTTypePNG (https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1). However the only filter options are mediaType and mediaSubTypes (https://developer.apple.com/documentation/photos/phfetchoptions). Hence I believe it's not possible to filter in the photos fetch request itself. – Pranav Kasetti May 15 '18 at 15:34

0 Answers0