title: Swift UIImagePickerController problem with photo in iCloud and allowsEditing
body: <p>I need help.
  I use UIImagePickerController to load the avatar. I can take a picture from camera and you can choose a photo.
  I have photos stored partly in iCloud, and only previews on the device, partly locally.
  When choosing a local photo or from camera, we get to the area selection screen, image cropping.
  So if the photo is stored in iCloud, then the following happens:</p>
  <p>I select a photo, click done - the window closes, but there is no photo.</p>
  <p>My code:</p>
  <p>Code for choose photo from library</p>
  <pre><code>func openMediaDialog() {
      
          PHPhotoLibrary.requestAuthorization({status in
                  if status == .authorized{
                      DispatchQueue.main.async {
                          self.imagePicker.sourceType = UIImagePickerController.SourceType.photoLibrary
                          //self.imagePicker.navigationItem.setHidesBackButton(false, animated: false)
                          //If you dont want to edit the photo then you can set allowsEditing to false
                          self.imagePicker.allowsEditing = true
                          self.imagePicker.delegate = self
                          self.present(self.imagePicker, animated: true, completion: nil)
                      }
                      
                  } else if status == .denied {
                  
                      self.alertCameraAccessNeeded(title: &quot;Необходим доступ к фото!&quot;, message: &quot;Для загрузки аватара необходим доступ к фото. Разрешить?&quot;)
                  }
          })
      
      
  }
  </code></pre>
  <p>DELEGATE:</p>
  <pre><code>override func imagePickerController(_ picker: UIImagePickerController,
                             didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
      /*
       Get the image from the info dictionary.
       If no need to edit the photo, use `UIImagePickerControllerOriginalImage`
       instead of `UIImagePickerControllerEditedImage`
       */
      
      guard let selectedImage = info[UIImagePickerController.InfoKey.editedImage] as? UIImage else {
          fatalError(&quot;Expected a dictionary containing an image, but was provided the following: \(info)&quot;)
          self.view.makeToast(&quot;Проблема с выбором изображения&quot;)
          
      }
      
      
      
      print(selectedImage)
  ....
  </code></pre>
  <p>NEXT STEP - UPLOAD IMAGE</p>
  <p>I ask you to tell me how to make sure that the photos are downloaded from icloud, cropped as needed and loaded further according to the usual scenario to the server.</p>