ios – How to programmatically open Share Activity within UIDocumentPickerViewController after presenting



Manually you can long press and show actions and select Share Acitivity that opens within the document picker view.

Is it possible to automate this process by code?

Press a button -> automatically open file directory -> automatically open share activity of that file.

    let picker = UIDocumentPickerViewController(
      forOpeningContentTypes: [
      asCopy: true)
    picker.delegate = self
    picker.directoryURL = fileDirectory
    self.present(picker, animated: true, completion: nil)

    // Now, after presenting
    // I want to automatically open Share Activity of that file