使用 UIDocumentPickerViewController 使用 icloud 获取所有文件[pdf,docx,doc,xlsxl,image]。这是我的代码
@IBAction func uploadNewResumeAction(_ sender: Any) {
let documentPicker = UIDocumentPickerViewController(documentTypes: ["public.text", "com.apple.iwork.pages.pages", "public.data"], in: .import)
documentPicker.delegate = self
present(documentPicker, animated: true, completion: nil)
}
extension SchoolRulesView: UIDocumentPickerDelegate{
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
let cico = url as URL
print(cico)
print(url)
print(url.lastPathComponent)
print(url.pathExtension)
}
}
在某些情况下只想显示一个文件 docx,pdf,xlsxl,images。这怎么可能?
还想获取 iphone 本地存储的 .docx 文件 [例如:要上传的 android 手机本地存储文件显示]。
同样想要获取所有 iphone 存储的本地文档并上传到服务器。怎么能成就我。帮助我提前感谢。