title: Passing image from ViewController to ViewController
body: <p>I try to pass an image from one <code>ViewController1</code> to another <code>ViewController2</code> when a button is tapped. I am using <code>segues</code> in my Storyboard.</p>
  
  <p><strong>ViewController1</strong></p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate {
  
      var imagePicker: UIImagePickerController!
  
      @IBAction func editPhoto(_ sender: UIButton) {
          let editViewController = storyboard?.instantiateViewController(withIdentifier: "EditImageViewController") as! EditImageViewController
          editViewController.imageForEdit = imageView.image!
          print(imageView)
          print(imageView.image!)
          navigationController?.pushViewController(editViewController, animated: true)
      }
  
      @IBOutlet weak var imageView: UIImageView! {
          didSet {
              imageView.contentMode = .scaleAspectFill
              imageView.clipsToBounds = true
          }
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  </code></pre>
  
  <p><code>print(imageView)</code> results in </p>
  
  <blockquote>
    <p>some(UIImageView: 0x7fc34df0e630; frame = (8 29; 303 443); clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = CALayer: 0x60000023e520)</p>
  </blockquote>
  
  <p>and <code>print(imageView.image!)</code> in </p>
  
  <blockquote>
    <p> size {3000, 2002} orientation 0 scale 1.000000</p>
  </blockquote>
  
  <p><strong>ViewController2</strong></p>
  
  <pre><code>import UIKit
  
  class EditImageViewController: UIViewController {
  
      var imageForEdit = UIImage()
  
      @IBOutlet weak var editingImage: UIImageView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          editingImage.image = imageForEdit
          print(imageForEdit)
          // Do any additional setup after loading the view.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  </code></pre>
  
  <p><code>print(imageForEdit)</code> results in </p>
  
  <blockquote>
    <p> size {0, 0} orientation 0 scale 1.000000</p>
  </blockquote>
  
  <p>Why is that? Why isnt the image passed to <code>ViewController2</code>?</p>