xcode 10 didFinishPickingMediaWithInfo info popover

I've embedded a popover in a static tableView cell. When I call the imagePicker and select an image the program hangs.


The image is successful returned in the didFinishPickingMediaWithInfo and the dismiss function executes without error. But after the end of this function is executed, the program hangs.


Sample source is listed below.


extension ViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {


func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {

// if let image = info[.originalImage] as? UIImage {

if let image = info[.editedImage] as? UIImage {

myimageView.contentMode = .scaleAspectFill

self.myimageView.image = image

} else if let image = info[.originalImage] as? UIImage {

self.myimageView.image = image

}

dismiss(animated: true)

}


func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {

dismiss(animated: true)

}

}


** XCode Version 10.1 (10B61), macOS Mojave Version 10.14.3