Hello, is it possible to reference a photo from the photo picker (either UIKit or SwiftUI), such that I do not need to copy it somewhere else? Currently, I am storing the copy in CoreData in a field with external storage, but it did cross my mind that I don't actually need a copy in my own storage if I could point back to the photo library. If the user deleted the photo from the library that would be fine.
Reference photo from picker, rather than copy?
This is not possible without photo library access.
With the many privacy enhancements added in iOS 14, it’s a good time to evaluate how and why your app uses PhotoKit to access the user’s library. Many apps may only need read-only access to retrieve images to share on the internet or embed in a document or email. For these purposes, the simplest way to provide an enhanced user experience is to use PHPickerViewController to access the Photos library. [...] Because the system manages its life cycle in a separate process, it’s private by default. The user doesn’t need to explicitly authorize your app to select photos, which results in a simpler and more streamlined user experience.
If your app requires PhotoKit’s advanced features, like retrieving assets and collections, or updating the library, the user must explicitly authorize it to access those features.
For more information, please refer to this documentation.