1

I have a standard code to open image picker, to select multiple images with it:

private func openFilesAction() {

    if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) {
        let imagePicker = UIImagePickerController()
        customizePicker(picker: imagePicker)
        imagePicker.delegate = self
        imagePicker.mediaTypes = ["public.movie"]
        imagePicker.sourceType = .photoLibrary;
        imagePicker.allowsEditing = false
        imagePicker.videoExportPreset = AVAssetExportPresetPassthrough
        imagePicker.videoQuality = .typeHigh
        self.present(imagePicker, animated: true, completion: nil)
    }
}

But, I would like to have an ability to open picker again, and add or remove pictures to current selection. So the next time I open a picker, previously chosen images to be preselected.

Is this possible with a default picker, or I will have to do it custom (using CollectionView)?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Whirlwind
  • 14,286
  • 11
  • 68
  • 157
  • How are you selecting multiple images with `UIImagePickerController`? It only supports selecting one image/video at a time. Or is that your question? Let the user pick one, show it again to let them pick another but show the previous selection? That isn't supported if that is what you are trying to do. – rmaddy Sep 25 '19 at 15:04
  • @rmaddy Yeah my bad, I didn't put a question correctly, I completely forgot that I can't make multiple selection with UIImagePickerController. Thanks for your help. – Whirlwind Sep 25 '19 at 15:07

1 Answers1

0

You are not able to use multiple selection and preselection using UIImagePickerController