title: UIImagePickerController delegate not called Swift 3
body: <p>On the surface I thought that this had to be a delegate issue, but after asking for the delegate the right one was returned.</p>
  
  <p>I created an ImagePicker class to handle all the UIImagePickerController stuff. Every thing works until the delegate methods need to be called. After I pick a photo, the imagePicker dismisses, but the <code>didFinishPickingMediaWithInfo</code> method never gets called. Please help! Thanks :)</p>
  
  <pre><code>func selectPhoto() {
      imagePicker.delegate = self //Delegate gets set here
  
      let photoAsk = UIAlertController.init( //Ask user if they want to take picture or choose one
          title: "Edit Profile Picture",
          message: nil,
          preferredStyle: .alert)
      let cameraAction = UIAlertAction.init(
          title: "Take Photo",
          style: .default) { (UIAlertAction) in
              if (UIImagePickerController.isSourceTypeAvailable(.camera)) {
                  self.imagePicker.sourceType = .camera
                  UIApplication.topViewController()!.present(self.imagePicker, animated: true, completion:nil)
              } else {
                  print("Cannot access camera in simulator.")
                  return
              }
      }
      let photoLibraryAction = UIAlertAction.init(
          title: "Photo Library",
          style: .default) { (UIAlertAction) in
              self.imagePicker.sourceType = .photoLibrary
              UIApplication.topViewController()!.present(self.imagePicker, animated: true, completion:nil)
              print("UIImagePickerDelegate: \(self.imagePicker.delegate.debugDescription)") // &lt;--THIS PRINTS OUT "AppName.ImagePicker: 0x145d7bdf0&gt;", and the class name is ImagePicker
      }
      let cancelAction = UIAlertAction.init(
          title: "Cancel",
          style: .cancel) { (UIAlertAction) in return }
  
      photoAsk.addAction(cameraAction)
      photoAsk.addAction(photoLibraryAction)
      photoAsk.addAction(cancelAction)
  
      imagePicker.mediaTypes = [kUTTypeImage as String]
  
      UIApplication.topViewController()?.present(photoAsk, animated: true, completion: nil)
      }
  }
  </code></pre>
  
  <p>This never gets called:</p>
  
  <pre><code>func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
      print("Image picked.") //NEVER PRINTS
  }
  </code></pre>