title: Swift - push & pop UIViewcontroller not working
body: <p>I am having problems with my <code>ViewControllers</code>. Does anyone know why that code is not working? The <code>print</code> function work...</p>
  
  <p><strong>A to B</strong></p>
  
  <pre><code>    @IBAction func editButtonTapped(_ sender: Any) {
      let imageCollectionView = self.storyboard?.instantiateViewController(withIdentifier: "ImageCollectionVC") as! ImageCollectionViewController
      imageCollectionView.delegate = self
      self.navigationController?.pushViewController(imageCollectionView, animated: true)
      print("editButtonTapped")
  }
  
  
  
  }
  
      extension ExampleViewController: ClassBDelegate {
              func childVCDidComplete( with image: UIImage?) {
                  self.pickedImage = image!
              }
      }
  </code></pre>
  
  <p><strong>B to A</strong></p>
  
  <pre><code> protocol ClassBDelegate {
      func childVCDidComplete(with image: UIImage?)
  }
  
  class ImageCollectionViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout{
  
      @IBOutlet weak var imageCollectionView: UICollectionView!
  
      var delegate: ClassBDelegate?
  var tappedImage = UIImage()
  
  func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
     tappedImage = images[indexPath.row]
     delegate?.childVCDidComplete(with: tappedImage)
     navigationController?.popViewController(animated: true)
  }
  </code></pre>
  
  <p>That is my full project: <a href="https://github.com/chriskonnerth/Wishlist" rel="nofollow noreferrer">https://github.com/chriskonnerth/Wishlist</a></p>
  
  <p>ViewController A in my case is <code>ExampleViewController</code> and B is <code>ImageCollectionViewController</code></p>
  
  <p><strong><em>UPDATE</em></strong></p>
  
  <p>that is my Storyboard: </p>
  
  <p><code>ImageViewController</code> is the right one and <code>ExampleViewController</code> is the one left to it.</p>
  
  <p><a href="https://i.stack.imgur.com/1wrRo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1wrRo.png" alt="enter image description here"></a></p>