我试图从Swift的画廊中获取图像。
func showPicker(type : UIImagePickerControllerSourceType) {
let imagePicker = UIImagePickerController()
imagePicker.delegate = self
imagePicker.sourceType = type
imagePicker.allowsEditing = false
self.present(imagePicker, animated: true, completion: nil)
}
然后:
self.showPicker(type: .savedPhotosAlbum)
然而,当我在我的设备上输入图库并选择照片时,没有任何事情发生,而是在日志中说:[Generic] Creating an image format with an unknown type is an error
如何关闭图库并保存图像?
答案 0 :(得分:4)
data.result.url
设置委托UIImagePickerControllerDelegate,UINavigationControllerDelegate
UIImagepickerView