0

I saved image to the Camera Roll with the function...

UIImageWriteToSavedPhotosAlbum(imurl!,nil,nil,nil)

How to get the name or URL of the saved image with function ??

2 Answers2

1

You can use ALAssetsLibrary framework to save image on disk.

Please try following method -

ALAssetsLibrary().writeImageToSavedPhotosAlbum(editedImage.CGImage, orientation: ALAssetOrientation(rawValue: editedImage.imageOrientation.rawValue)!,
            completionBlock:{ (path:NSURL!, error:NSError!) -> Void in
                print("Image path - \(path)")
        })
Meet
  • 609
  • 6
  • 10
0
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {

          let imageUrl = info[UIImagePickerControllerReferenceURL] as! NSURL
          // here you got file path that you select from camera roll

          let image = info[UIImagePickerControllerOriginalImage] as! UIImage
         // here you got image that select from camera roll now just save it

         self.dismiss(animated: true, completion: nil)
 }
Himanshu Moradiya
  • 4,769
  • 4
  • 25
  • 49