Swift UIDocumentPickerViewController 没有像 Action sheet 弹出窗口那样显示

Swift UIDocumentPickerViewController not showing like Action sheet popup

我正在尝试访问第三方云应用程序。我的应用程序上传按钮点击打开 UIDocumentPickerViewController 并需要选择文件(单个或多个),然后我正在上传我的服务器。

  1. 上传按钮点击UIDocumentPickerViewController打开全屏不打开喜欢的动作sheet.

  2. 需要访问所有类型的文件。

下面是我的代码

let importMenu = UIDocumentPickerViewController(documentTypes: ["public.text", "com.apple.iwork.pages.pages", "public.data"], in: .import)
importMenu.delegate = self
importMenu.modalPresentationStyle = .formSheet            
if let popoverPresentationController = importMenu.popoverPresentationController {
    popoverPresentationController.sourceView = self.view;
    //popoverPresentationController.sourceView = sender as? UIView
    //popoverPresentationController.sourceRect = sender.bounds
}
self.present(importMenu, animated: true, completion: nil)  

检查文档你的答案在下图中。