UIDocumentPickerViewController无法正常工作,我不确定这是错误的还是对“文档”的误解。
如果我设置UIDocumentPickerViewController的directoryURL,似乎只是忽略它。例如
目录URL是file:/// var / mobile / Containers / Data / Application / abcdefgh-abcd-efgh-ijkl-mnopqrstuvwx / Downloads /。
但是这段代码从我上次提供UIDocumentPickerViewController的上次开始在目录中打开它:
crosswordPuzzleDocumentPickerVC = UIDocumentPickerViewController(documentTypes: ["public.item"], in: .import)
crosswordPuzzleDocumentPickerVC.delegate = self
crosswordPuzzleDocumentPickerVC.modalPresentationStyle = .formSheet
crosswordPuzzleDocumentPickerVC.directoryURL = crosswordPuzzleDownloadsURL
fileBeingOpened = .crosswordPuzzleFile
self.present(crosswordPuzzleDocumentPickerVC, animated: true)
}
为什么不注意directoryURL?
任何帮助将不胜感激,我的应用程序 this 即将准备提交,但是让用户为一个文件夹而苦苦挣扎似乎很便宜。