title: Image selected from iOS PhotoLibrary doesn't show in UIImageView
body: <p>I'm trying to use a <code>UIImagePickerController</code> to show a image picked from the Photo Library, but when I select the image, nothing happens.</p>
  
  <p>All I'm doing is from <a href="https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/WorkWithViewControllers.html#//apple_ref/doc/uid/TP40015214-CH6-SW1" rel="nofollow noreferrer">Apple's Swift tutorial</a>, so the code shouldn't be wrong, I guess. It doesn't work neither in simulator nor on a real device. I've tried all suggestions I found while googling. My code:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
  
  //MARK: Properties
  @IBOutlet weak var nameTextField: UITextField!
  @IBOutlet weak var mealNameLabel: UILabel!
  @IBOutlet weak var photoImageView: UIImageView!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      nameTextField.delegate = self
  }
  
  //MARK: Actions
  
  @IBAction func selectImageFromPhotoLibrary(sender: UITapGestureRecognizer) {
  
      // Hide the keyboard.
      nameTextField.resignFirstResponder()
  
      // UIImagePickerController is a view controller that lets a user pick media from their photo library.
      let imagePickerController = UIImagePickerController()
  
      // Only allow photos to be picked, not taken.
      imagePickerController.sourceType = .photoLibrary
  
      // Make sure ViewController is notified when the user picks an image.
      imagePickerController.delegate = self
      present(imagePickerController, animated: true, completion: nil)
  
      func imagePickerControllerDidCancel(picker: UIImagePickerController) {
          // Dismiss the picker if the user canceled.
          dismiss(animated: true, completion: nil)
      }
  
      func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
  
          // The info dictionary may contain multiple representations of the image. You want to use the original.
          guard let selectedImage = info[UIImagePickerControllerOriginalImage] as? UIImage else {
              fatalError("Expected a dictionary containing an image, but was provided the following: \(info)")
          }
  
          // Set photoImageView to display the selected image.
          photoImageView.image = selectedImage
  
          // Dismiss the picker.
          dismiss(animated: true, completion: nil)
      }
  }
  
  @IBAction func setDefaultLabelText(sender: UIButton) {
      mealNameLabel.text = "Default Text"
  }
  
  //MARK: UITextFieldDelegate
  
  func textFieldShouldReturn(_ textField: UITextField) -&gt; Bool {
      textField.resignFirstResponder()
      return true
  }
  
  func textFieldDidEndEditing(_ textField: UITextField) {
      mealNameLabel.text = textField.text
  }
  }
  </code></pre>
  
  <p>I can provide more information if necessary. Thanks in advance.</p>