UIDocumentPickerViewController:如何在iOS中选择文件夹?

时间:2019-06-26 00:54:54

标签: ios swift uidocumentpickerviewcontroller

我想使用UIDocumentPickerViewController来选择一个文件夹,然后读取该文件夹的内容。我使用以下代码,但是点击文件夹不会导致调用didPickDocumentsAt委托。我需要的只是该文件夹的URL。

    let documentPicker = UIDocumentPickerViewController(documentTypes: [String(kUTTypeFolder)],  in: .open)
    documentPicker.delegate = self
    documentPicker.allowsMultipleSelection = true
    present(documentPicker, animated: true) {
        print("done presenting")
    }

0 个答案:

没有答案