Reload images from PHPickerViewController

I'm writing an app which allow users to pick images from photo library by swiftUI. I wrap PHPickerViewController in representable to achieve the functionality. The benefit is that users don’t need to explicitly authorize my app to select photos.

func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult])

Currently, I get images by picker(::) method above and save images in my app in order to reload images the next time users launch the app without needs to request authorization.

Obviously, if the app stores references to the selected images, rather than images themselves, it can prevent from taking up large amounts of space. Is it meaning that I have to prompt to users for requesting authorization to access the library? Is there any approach only to use references and reload images which were selected by users previously from photo library using PHPickerViewController, supporting no need to request authorization.

Answered by Engineer in 737652022
  1. Storing your own image copies could still be cheap thanks to AFPS cloning, if they already exist locally. But you do need to manage those files manually.
  2. It’s usually recommended to store your own images because the assets in the user photo library can be modified, moved, or deleted at any time. But if you want to have those changes reflected in your app automatically, then it might be a good idea to only store image references. What’s your customers’ expectation?
  3. You have to request photo library access to store image references.
Accepted Answer
  1. Storing your own image copies could still be cheap thanks to AFPS cloning, if they already exist locally. But you do need to manage those files manually.
  2. It’s usually recommended to store your own images because the assets in the user photo library can be modified, moved, or deleted at any time. But if you want to have those changes reflected in your app automatically, then it might be a good idea to only store image references. What’s your customers’ expectation?
  3. You have to request photo library access to store image references.
Reload images from PHPickerViewController
 
 
Q