【发布时间】:2019-04-04 03:28:09
【问题描述】:
我正在尝试从UIDocumentPickerViewController 获取扩展名的选定文件名,但文件名的文件扩展名末尾有“]”。关于正确方法的任何建议?
这是我的代码:
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
let filename = URL(fileURLWithPath: String(describing:urls)).lastPathComponent // print: myfile.pdf]
self.pickedFile.append(filename)
// display picked file in a view
self.dismiss(animated: true, completion: nil)
}
【问题讨论】:
标签: ios swift uidocumentpickerviewcontroller