writeImage(toSavedPhotosAlbum:metadata:completionBlock:)
Writes a given image and metadata to the Photos Album.
Declaration
func writeImage(toSavedPhotosAlbum imageRef: CGImage!, metadata: [AnyHashable : Any]!, completionBlock: (@Sendable (URL?, (any Error)?) -> Void)!)func writeImage(toSavedPhotosAlbum imageRef: CGImage!, metadata: [AnyHashable : Any]!) async throws -> URL?Parameters
- imageRef:
The image to add to the album.
- metadata:
The metadata to associate with the image.
- completionBlock:
The block invoked after the save operation completes.
For a description of the block, see Alassetslibrarywriteimagecompletionblock.
Discussion
You must specify the orientation key in the metadata dictionary to preserve the orientation of the image.