2

I am wondering how one could duplicate a PHAsset and preserve the photo's context. For example if the photo was located in a specific album, I want the duplicate to be located in that same album right next to the original. And if possible, the edit history would be preserved, allowing the user to revert that duplicate to the original if desired.

One could implement a share sheet and share the image, which would provide an option to save the image, but this isn't true duplication. Saving the image places it at the end of All Photos. If I create a new asset providing the image from my existing asset via creationRequestForAssetFromImage, that too is placed at the end of All Photos.

How can one programmatically duplicate a given PHAsset, preserving its location in the photos album hierarchy?

4

1 に答える 1