如何初始化 UIDocumentPickerViewController 注意 "forOpeningContentTypes"(来自 doco)似乎在 IOS 中被弃用?

how to initalise UIDocumentPickerViewController noting "forOpeningContentTypes" (from doco) seems to be deprecated in IOS?

当遵循 IOS UIDocumentPickerViewController 在 Xcode 12.5.1 和 IOS 14.5 部署目标的现场 IOS 文档时,我得到一个错误:

Incorrect argument label in call (have 'forOpeningContentTypes:', expected 'forExporting:')

关于 IOS UIDocumentPickerViewController 现在应该如何使用的任何建议?

我的代码除外:

// Create a document picker for directories.
let documentPicker =
    UIDocumentPickerViewController(forOpeningContentTypes: [.folder])
documentPicker.delegate = self

错误快照:

有关如何在此处使用文档选择器的文档:

https://developer.apple.com/documentation/uikit/view_controllers/providing_access_to_directories 给出:

你忘了

import UniformTypeIdentifiers