如何显示来自iclouds的特定文件格式源自iOS Swift [英] How to show particular file format from iclouds derive in ios swift

查看:152
本文介绍了如何显示来自iclouds的特定文件格式源自iOS Swift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,从iclouds导出文件。想要上传xlsx,docx,txt。

In my application upload the file from iclouds derive. want to upload xlsx, docx, txt.

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

want to upload the xlsx file means from iclouds derive want to display only xlsx another files should not display.[docx,txt]

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

same if the user want to display docx file means xlsx and txt ,xlsx file should not be display.

此处是我的代码

 @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
    }
}

派生出所有文件都在最近添加的列表中显示。希望仅在列表中显示特定文件。如何达到帮助我。感谢Advance

from iclouds derive all files are diplaying in recently added list. want to display only particular file in the list. how to achive help me. Thank advance

推荐答案

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

Just adjust the documentTypes: argument when creating your document picker.

documentTypes:[ org.openxmlformats.wordprocessingml.document]

将只允许用户选择docx文件。

will let the user only select docx files.

documentTypes:[ org.openxmlformats.spreadsheetml.sheet ]

仅允许用户选择xlsx文件。

will let the user only select xlsx files.

这篇关于如何显示来自iclouds的特定文件格式源自iOS Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆