1

在我的应用程序中,我想从 iCloud 导入 .sqlite 以恢复数据,但它没有显示 iCloud 驱动器一切都已管理,iCloud 权利已经开启,并且从开发者帐户启用

iCloud 权利

在我的应用程序中,我已集成此代码

    @IBAction func btnImport(_ sender: Any) {
        //let importMenu = UIDocumentPickerViewController(documentTypes: [String(kUTTypePDF)], in: .import)
        let importMenu = UIDocumentMenuViewController(documentTypes: [String(kUTTypePNG),String(kUTTypeImage)], in: .import)
        importMenu.delegate = self
        importMenu.modalPresentationStyle = .fullScreen
        self.present(importMenu, animated: true, completion: nil)
    }


extension MoreViewController : UIDocumentMenuDelegate, UIDocumentPickerDelegate {

    func documentMenu(_ documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {
        documentPicker.delegate = self
        self.present(documentPicker, animated: true, completion: nil)
    }

    func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
        print("url = \(url)")
    }

    func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
        dismiss(animated: true, completion: nil)
    }
}

但它只告诉我这个

输出

在此处输入图像描述

4

0 回答 0