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 ??
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 ??
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)")
})
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)
}