FKDev
FKDev

Reputation: 2286

UIDocumentPickerViewController: how to open a given subdirectory

I am using UIDocumentPickerViewController with the import mode (UIDocumentPickerModeImport) in order to let the user import documents from cloud storage providers (dropbox, etc). Each time the user repeat the import process, he must browse through its folder hierarchy starting from the root of its cloud storage.

Is there a way to present a document picker on a given subdirectory ?

I am aware of the method:

[NSURL bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:]   

But I cannot connect the dots with the Document picker presentation options. I would expect a picker option to present a document picker on a given bookmarked directory url.

Upvotes: 9

Views: 2940

Answers (2)

Kirit  Vaghela
Kirit Vaghela

Reputation: 12674

You need to try with UIDocumentBrowserViewController

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

Upvotes: 2

Vladimir Prigarin
Vladimir Prigarin

Reputation: 474

You need init UIDocumentPickerViewController with url. For this action you can (and must) use initWithURL:inMode: method. That's all :)

Upvotes: 4

Related Questions