RiddlerDev
RiddlerDev

Reputation: 7469

How to open an image saved to the Photo Album in Swift?

I am using UIImageWriteToSavedPhotosAlbum to save an image to the user's photo album. After that new image is saved, is there a way to open that new file? (I want to basically take the user to the photo album so that they can share the image if they want)

Upvotes: 1

Views: 1157

Answers (2)

Loanb222
Loanb222

Reputation: 851

Since you are saving the image you could present the image(s) in an image view while the images are being saved and then present the UIActivityViewController to share the image(s). Without the user having to pick the image through a UIImagePickerViewController.

Upvotes: 0

matt
matt

Reputation: 535925

You can present a Photos-like interface with UIImagePickerController, but you can't use that to make the user pick that particular photo. The user just sees the whole photos library and can pick any photo, and that's all.

So, if you just want the user to be able to share this one photo, or alternatively if what you want the user to be able to do with this one photo is share it, then you must fetch it out of the photos library (using the Photos framework) and provide interface for sharing it (using UIActivityViewController).

Upvotes: 1

Related Questions