You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

适配UIDocumentPickerViewController的文字处理文档标准UTType查询

问题解答
  • 存在可同时覆盖doc、docx、pages等文字处理文档的内置UTType:UTTypeWordProcessing
  • 该类型是iOS 14及以上系统提供的,涵盖了主流文字处理格式,包括但不限于:
    • Microsoft Word系列:doc、docx
    • Apple Pages格式:pages
    • 其他常见格式:rtf、rtfd
  • 代码示例:
import UIKit
import UniformTypeIdentifiers

// 初始化支持文字处理文档的选择器
let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [.wordProcessing])
documentPicker.delegate = self
present(documentPicker, animated: true)
  • 补充:若需兼容iOS 13及以下版本,仍需使用自定义UTI字符串;仅支持iOS 14+的话,UTTypeWordProcessing完全能满足需求。

内容的提问来源于stack exchange,提问作者Kenny Wyland

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 10:55:01