UIDocumentPickerViewController customActions?

时间:2019-05-08 15:12:37

标签: ios swift uidocumentpickerviewcontroller

是否有人知道是否可以像在UIDocumentBrowserViewController中那样向UIDocumentPickerViewController添加customAction的选项? 或者,如果可以更改“打开”按钮的标题。 (浏览器控制器中的自定义操作可以做到这一点,但是其中没有关闭按钮。根据文档,它应该是应用程序的根控制器,因此我尝试更改选择器控制器)。

let browser = UIDocumentBrowserViewController(forOpeningFilesWithContentTypes: ["public.directory"])
browser.allowsDocumentCreation = false
browser.allowsMultipleSelection = true

let action = UIDocumentBrowserAction(identifier: "myActionID", localizedTitle: "Choose this folder", availability: .navigationBar) { (urls) in
   browser.dismiss(animated: true, completion: nil)
}
browser.customActions = [action]

self.present(browser, animated: true, completion: nil)

我希望在UIDocumentPickerViewController中获得与上述代码相同的结果。

0 个答案:

没有答案