Tôi có một VC "A" hiện tại VC "B" một cách bình thường. B trình bày một giao thức UIDocumentMenuViewController
Các UIDocumentMenuDelegate
được thực hiện trong B.UIDocumentMenuViewController loại bỏ trình điều khiển xem trình bày
Ngay sau khi documentMenuWasCancelled(_ documentMenu:)
hoặc documentMenu(_:didPickDocumentPicker:)
được gọi là dismiss(animated:completion:)
của B được gọi và tôi không có đầu mối tại sao.
Dưới đây là mã của tôi
func presentDocumentPicker() {
let documentTypes = [
kUTTypeCompositeContent as String,
kUTTypePDF as String,
"com.microsoft.word.doc",
"vnd.openxmlformats-officedocument.wordprocessingml.document"
]
let documentMenuViewController = UIDocumentMenuViewController(documentTypes: documentTypes, in: .import)
documentMenuViewController.delegate = self
present(documentMenuViewController, animated: true, completion: nil)
}
// MARK: - Document Menu View Controller Delegate
func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {
print("did pick")
}
func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
print("was cancelled")
}
Như bạn có thể thấy tôi không phải làm gì trong hàm đại biểu thực hiện. Và B vẫn bị bác bỏ. Tôi không hiểu.
Bạn có thể gửi nhiều dự án đến hoặc ít nhất toàn bộ ViewControllers bạn có ở đó không? –
Thực ra ngay bây giờ tôi không thể tái tạo nó: D – lukwuerz
có thể có vấn đề về cách bạn trình bày cả hai bộ điều khiển .. –