2

I'm implementing the new PHPickerViewController as follows:

func importMedia() {
    var config = PHPickerConfiguration()
    config.selectionLimit = 1
    //config.filter = PHPickerFilter.images

    let pickerViewController = PHPickerViewController(configuration: config)
    pickerViewController.delegate = self
    self.present(pickerViewController, animated: true, completion: nil)
}

And:

func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
    picker.dismiss(animated: true) {
        // Handle resultant media
    }
}

Is there any way to get some form of confirmation dialog to the user when they select a photo/video? As it stands, tapping media just instantly dismisses the PHPickerViewController and handles the selected media accordingly, whereas with my previous UIImagePickerController implementation, after tapping a photo/video it would then show a preview dialog with a "cancel" and "choose" button at the bottom. I assume this may have something to do with using picker.allowsEditing = true for that implementation - does something similar exist with PHPickerViewController?

I guess I could add a UIAlertController in the delegate method, before handing the selected media, but it would probably be quite clunky...

SwiftArtery
  • 296
  • 1
  • 10
  • If the selectionLImit is 1 for the PHPickerConfiguration, there is no confirmation step. If it’s > 1, there is a confirmation step. This seems like pretty odd UI/UX to me. – Chris Prince Dec 31 '20 at 17:31

0 Answers0