title: Selected Image from UIImagePickerController not showing up in UIImageView
body: <p>I am trying to display a selected image from a UIImagePickerController inside a collectionViewCell that is holding a UIImageView. I am able to open and load the imagePicker, but when I select an image the UIImageView still has the hard original placeholder image. I believe it has something to do with passing the selectedImage into the actual cell, and not to the loginController, but I am not sure. Thanks in advance for any help!</p>
  
  <p>// loginCell class
  class LoginCell: UICollectionViewCell, UIImagePickerControllerDelegate, UINavigationControllerDelegate {</p>
  
  <pre><code>lazy var profileImageView: UIImageView = {
      let imageView = UIImageView()
      imageView.image = UIImage(named: "imagefile")
      //...
      imageView.addGestureRecognizer(UITapGestureRecognizer(target:self, action: #selector(handleSelectProfileImage)))
      imageView.isUserInteractionEnabled = true
      return imageView
  }()
  
  var loginController: LoginController?
  
  func handleSelectProfileImage() {
      guard let loginController = delegate as? LoginController else {
          return
      }
      loginController.showImagePicker()
  }
  </code></pre>
  
  <p>}</p>
  
  <p>// login controller class
  class LoginController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, LoginControllerDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {</p>
  
  <pre><code>weak var loginCollectionView: UICollectionView!
  
  func showImagePicker() {
      let picker = UIImagePickerController()
      picker.delegate = self
      picker.allowsEditing = true
      present(picker, animated: true, completion: nil)
  }
  
  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
  
      var selectedImageFromImagePicker: UIImage?
  
      if let editedImage = info["UIImagePickerControllerEditedImage"] as? UIImage {
          selectedImageFromImagePicker = editedImage
      } else if let originalImage = info["UIImagePickerControllerOriginalImage"] as? UIImage {
          selectedImageFromImagePicker = originalImage
      }
  
      if let selectedImage = selectedImageFromImagePicker {
          loginCell.profileImageView.image = selectedImage
      }
      dismiss(animated: true, completion: nil)
  }
  
  func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
      dismiss(animated: true, completion: nil)
  }
  
  func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
          let loginCell = collectionView.dequeueReusableCell(withReuseIdentifier: loginCellId, for: indexPath) as! LoginCell
          loginCell.delegate = self
          return loginCell
  }
  </code></pre>