Skip to content

Instantly share code, notes, and snippets.

@iosdevie
Created May 26, 2021 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iosdevie/81f5cb09a925a59929d3ad36e0395755 to your computer and use it in GitHub Desktop.
Save iosdevie/81f5cb09a925a59929d3ad36e0395755 to your computer and use it in GitHub Desktop.
func showPreviewImage(image: UIImage)
{
let alert = UIAlertController(title: "Preview", message: "", preferredStyle: .actionSheet)
alert.addPreviewImage(image: image)
alert.addAction(UIAlertAction(title: "Add To Photos", style: .default){
action in
UIImageWriteToSavedPhotosAlbum(image, self, nil, nil)
})
alert.addAction(UIAlertAction(title: "Cancel", style: .destructive, handler: nil))
present(alert,
animated: true,
completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment