Я хочу выполнить переход сразу после того, как пользователь выберет изображение (нажав на изображение).
Я уже проверил идентификатор segue и успешно смог соединить оба контроллера представления.
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
// Executed when we select an image from the photo library.
if let image = info[UIImagePickerControllerOriginalImage] as? UIImage {
// Sets the image to the image view (not really relevant because
// we push the user to the DetailVC, but let's leave it).
self.imageView.image = image
// Closing the image picker.
self.dismiss(animated: true, completion: nil)
// Performing segue (It doesn't perform!).
print("It gets to this point, but doesn't perform.")
self.performSegue(withIdentifier: "showDetail", sender: nil)
}
}
Программа задает изображение для представления изображения, получает этот оператор печати сразу после функции "execute", но переход не выполняется.