这是我的代码,请检查是否正确:
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)