私のアプリケーションではUIDocumentPickerViewController
、ユーザーがファイルを選択 (インポート) できるようにしていましたが、iOS 13 以降ではその機能が動作しなくなり、基本的にドキュメント ピッカーは開いていますが、ユーザーはファイルを選択できません (ファイルをテーピングしても何もしません)。 .
コードを分離するためだけに簡単なサンプルを作成しました。
class ViewController: UIViewController, UIDocumentPickerDelegate {
@IBAction func openDocumentPicker(_ sender: Any) {
let types = [String(kUTTypePDF)]
let documentPickerViewController = UIDocumentPickerViewController(documentTypes: types, in: .import)
documentPickerViewController.delegate = self
present(documentPickerViewController, animated: true, completion: nil)
}
func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
print("Cancelled")
}
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
print("didPickDocuments at \(urls)")
}
}
サンプル プロジェクト: https://github.com/Abreu0101/document-picker-iOS13-issue