Search code examples
iosobjective-cuikit

Requesting photo access from preview on iOS


When opening images using presentPreviewAnimated: share menu contains "Save Image" option. It works fine if user gave access to photos before (and if user explicitly disabled access there's no such option at all), but otherwise app crashes. I can check permission before opening file, but it would be wrong if the user doesn't need to save it.

How can I check if user wants to save image and permission request is needed?


Solution

  • Solved by adding NSPhotoLibraryAddUsageDescription to plist, thanks to this post.