gpt4 book ai didi

ios - 如何在 ios swift 中显示 icloud 驱动器中的特定文件格式

转载 作者:行者123 更新时间:2023-11-30 11:05:35 24 4
gpt4 key购买 nike

在我的应用程序中上传来自 iclouds 的文件。想要上传xlsx、docx、txt。

想要上传 xlsx 文件意味着从 iclouds 导出只想显示 xlsx,其他文件不应显示。[docx,txt]

如果用户要显示docx文件,则同样意味着xlsx和txt,不应显示xlsx文件。

这是我的代码

 @IBAction func moveiclouds_BtnClick(_ sender: Any) {
let documentPicker = UIDocumentPickerViewController(documentTypes: [kUTTypePDF as String, "com.microsoft.word.doc", "com.microsoft.excel.xls", kUTTypeCompositeContent as String, kUTTypeJPEG as String], in: .import)
documentPicker.delegate = self
self.present(documentPicker, animated: true, completion: nil)
}


extension CreateFeesView: UIDocumentPickerDelegate{
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
let cico = url as URL
cico_files = cico
filepath_fees = url.pathExtension
}
}

enter image description here

从 iclouds 导出最近添加的列表中显示的所有文件。只想显示列表中的特定文件。如何实现帮助我。提前致谢

最佳答案

只需在创建文档选择器时调整 documentTypes: 参数即可。

文档类型:[“org.openxmlformats.wordprocessingml.document”]

将让用户仅选择 docx 文件。

文档类型:[“org.openxmlformats.spreadsheetml.sheet”]

将让用户仅选择 xlsx 文件。

关于ios - 如何在 ios swift 中显示 icloud 驱动器中的特定文件格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52777175/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com