2

I am developing an application which has the capability to import an audio file from other cloud resources which provide UIDocumentPickerViewControllerExtenstion to choose the file but there is location button on the top left side I want to remove this.

below is my code :

let menupicker = UIDocumentMenuViewController(documentTypes: [kUTTypeAudio as String], in: .import)
menupicker.delegate = self
self.present(menupicker, animated: true, completion: nil)



func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {
    documentPicker.delegate = self
    documentPicker.navigationItem.leftBarButtonItem = nil
    self.present(documentPicker, animated: true) { 
        documentPicker.navigationItem.leftBarButtonItem = nil
        documentPicker.navigationItem.backBarButtonItem = nil
        documentPicker.navigationItem.hidesBackButton = true
    }
}

enter image description here

Dhaval Patel
  • 716
  • 1
  • 10
  • 26

1 Answers1

0

I'm looking for the same solution, but can't. From my understanding, it is impossible. If you loop through the UIDocumentPickerViewController, it actually has a child view controller with type of "_UIResilientRemoteViewContainerViewController"

let picker = UIDocumentPickerViewController(documentTypes: supportDocTypes, in: .import)
picker.delegate = self
present(picker, animated: true) {
    print(picker.childViewControllers) // you will get something like this: [<_UIResilientRemoteViewContainerViewController: 0x102e956c0>]
}

which is not accessible, we could however access it by looping through it, and you will eventually get some other private components such as _RemoteView.

Alex
  • 135
  • 1
  • 15