ios - 从 ios 中的文档选择器中选择文件时如何防止编辑文件(重命名、共享等)
问题描述
我已经实现了一个文档选择器,并希望在浏览文档选择器时避免编辑文件和文件夹(例如重命名、复制、共享等选项)。任何人都可以帮助我,因为对于 UIDocumentPickerViewController 没有类似的 allowEditing。
func documentPicker(from view: UIView) {
let importMenu = UIDocumentPickerViewController(documentTypes: [String(kUTTypePDF),
String(kUTTypeJPEG), String(kUTTypeGIF)], in: .import)
importMenu.delegate = self
importMenu.setEditing(false, animated: false)
importMenu.modalPresentationStyle = .popover
if let presentation = importMenu.popoverPresentationController {
presentation.permittedArrowDirections = .any
presentation.sourceView = view
presentation.sourceRect = view.bounds
}
parentController?.present(importMenu, animated: true, completion: nil)
}
解决方案
推荐阅读
- azure - MS Logic Apps:将文件添加到 SharePoint 触发器不一致
- typescript - 如何调用一个组件中的方法,它会调用另一个组件中的另一个方法?
- google-sheets - Google表格中线性回归的多个独立变量
- php - PHP Form-是否可以在同一个表名中插入多个输入字段
- openssl - 使用 InfluxDb 和 Telegraf for Grafana 时出现 Http TLS 握手错误
- python - 在 tkinter python 中的树视图中搜索项目
- reactjs - 服务器端渲染不适用于生产构建 Next.js
- git - 为什么我有多个 gitignore 文件?
- java - 如何使用java在物理打印机上打印长页?
- google-api - 如何重置 Google API 项目