In one VC I am working in there are three buttons, and each button should present a document picker for different types of media. I have this configured-- but what I am not sure how to do is to handle my delegate method
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
How can I monitor which document picker set off the delegate method, since every button should handle this function differently? I tried to use controller.tag, but this doesn't seem to be a property of a UIDocumentPickerViewController. Any pointers would be much appreciated thanks.
You can create 3 separate instances of
UIDocumentPickerViewControllerin your view controller and check the instance ofcontrollerin delegate method.Or you could keep a property in
view controllerto track which button was tapped and check it in the delegate method.