Свифт 4.
У меня была такая же проблема, и я смог ее исправить, добавив
dismiss(animated: true, completion: nil)
в конце
imagePickerController(_:didFinishPickingMediaWithInfo:)
Пример:
extension MyViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let pickedImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
// Do something with your image
...
}
dismiss(animated: true, completion: nil)
}
}