我有一个要删除的类,之后我的添加项一直崩溃。
下面是按钮
@IBAction func cameraButton_TouchUpInside(_ sender: Any) {
let imagePickerController = ImagePickerController()
imagePickerController.delegate = self
imagePickerController.imageLimit = 1
present(imagePickerController, animated: true, completion: nil)
}
func wrapperDidPress(_ imagePicker: ImagePickerController, images: [UIImage]) {
}
func doneButtonDidPress(_ imagePicker: ImagePickerController, images: [UIImage]) {
guard let image = images.first else {
dismiss(animated: true, completion: nil)
return
}
if let image = info["UIImagePickerControllerOriginalImage"] as? UIImage{
selectedImage = image
photo.image = image
dismiss(animated: true, completion: nil)
// dismiss(animated: true, completion: {
// self.performSegue(withIdentifier: "Camera", sender: nil)
// })
}
如果我取消注释,当我尝试从库中进行选择时,我的应用程序崩溃上方的内容
更多
// override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// if segue.identifier == "filter_segue" {
// let filterVC = segue.destination as! FilterViewController
// filterVC.selectedImage = self.selectedImage
// filterVC.delegate = self
// }
// }
//extension CameraViewController: FilterViewControllerDelegate {
// func updatePhoto(image: UIImage) {
// self.photo.image = image
// self.selectedImage = image
// }
//}