我使用功能...
将图像保存到相机胶卷UIImageWriteToSavedPhotosAlbum(imurl!,nil,nil,nil)
如何使用函数获取已保存图像的名称或URL
答案 0 :(得分:1)
您可以使用ALAssetsLibrary框架将图像保存在磁盘上。
请尝试以下方法 -
ALAssetsLibrary().writeImageToSavedPhotosAlbum(editedImage.CGImage, orientation: ALAssetOrientation(rawValue: editedImage.imageOrientation.rawValue)!,
completionBlock:{ (path:NSURL!, error:NSError!) -> Void in
print("Image path - \(path)")
})
答案 1 :(得分: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)
}