UIDocumentPickerViewController: how to open this subdirectory

I use a UIDocumentPickerViewController with import mode (UIDocumentPickerModeImport) to allow the user to import documents from cloud storage providers (dropbox, etc.). Each time the user repeats the import process, he should look at the hierarchy of his folders, starting from the root of the cloud storage.

Is there any way to present the document collector in this subdirectory?

I know the method:

[NSURL bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:] 

But I can’t connect the dots with the presentation options of the document collector. I would expect the selection option to represent the document picker at the given bookmark URL.

+6
source share
2 answers

You need init UIDocumentPickerViewController with a url. For this action, you can (and should) use the initWithURL: inMode: method . What all:)

+2
source

You need to try UIDocumentBrowserViewController

UIDocumentBroswerViewContoller has an importDocument (at: nextToDocumentAt: mode: completeHandler :) method for importing documents from local as well as remote, such as dropbox, iCloud, etc.

+2
source

Source: https://habr.com/ru/post/986638/


All Articles