问题描述
我正在尝试使用 UIImagePickerController.它曾经工作正常,但突然停止工作.
I'm trying to use UIImagePickerController.It used to work fine but suddenly stopped working.
目前,我的结果不一致(有时有效,有时无效).以下是与 UIIMagePickerController 相关的方法.
Currently, I have inconsistent results(it sometimes works but sometimes doesn't).Here are methods related to UIIMagePickerController.
怎么了?
@IBAction func uploadImageTapped(_ sender: UIButton) {
let pickerView = UIImagePickerController()
// Set cameraroll sor chooseing a photo
// choose '.camera' if you want to take the picture
pickerView.delegate = self
pickerView.sourceType = .photoLibrary
self.present(pickerView, animated: true, completion: nil)
}
.
.
.
extension RetailerProfileViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
// method that will be called when user choose the pic
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
// get the info of photo
let image = info[.originalImage] as! UIImage
// show it
storeImage.image = image
// dismiss the photo library
self.dismiss(animated: true)
}
}
推荐答案
您可以在这里查看.https://stackoverflow.com/a/60397039/12494594
我检查了详细信息,您的实施没有问题.我还在这里检查了苹果的官方样本.https://developer.apple.com/documentation/uikit/uiimagepickercontroller/customizing_an_image_picker_controller 同样的结果!
I checked the details, and there are no issues in your implementation. I also checked the apple's official sample here. https://developer.apple.com/documentation/uikit/uiimagepickercontroller/customizing_an_image_picker_controller Same result!
最后,这是一个与 iOS 模拟器(版本 11.3.1)相关的问题.我只是希望你们不要在这上面浪费时间.继续前进.
Finally, this is an issue related to iOS Simulators(version 11.3.1). I just want you guys not wasting time on this. Move ahead.
谢谢.
这篇关于不断收到错误:“UIImagePickerController 扩展发现失败,错误:(空)";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!