i用功能将图像保存到相机卷中...
uiimagewritetosavedphotosalbum(imurl!,nil,nil,nil)
如何通过功能获取保存图像的名称或URL ??
您可以使用AlassetSlebrary框架在磁盘上保存图像。
请尝试以下方法 -
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)
}