能否在单击按钮时打开所有文档存储应用程序以从Swift 4中的特定应用程序选择文档?

时间:2018-09-03 10:54:14

标签: ios swift uidocumentpickerviewcontroller

这是我的代码,请检查是否正确:

let importMenu = UIDocumentMenuViewController(documentTypes: [String(kUTTypeCompositeContent)], in: .import)
importMenu.delegate = self
importMenu.modalPresentationStyle = .formSheet

if let popoverPresentationController = importMenu.popoverPresentationController {
    popoverPresentationController.sourceView = sender
    // popoverPresentationController.sourceRect = sender.bounds
}
self.present(importMenu, animated: true, completion: nil)

0 个答案:

没有答案