gpt4 book ai didi

ios - 在我的 iPhone 文件夹中,如何为我的应用创建文件夹? [iOS 13]

转载 作者:行者123 更新时间:2023-11-28 07:20:52 25 4
gpt4 key购买 nike

我想在"file"应用中为我的应用创建一个文件夹,以便在我想从我的应用中保存文件时进行访问

在 iOS 12 及更早版本中,我可以通过启用

应用程序支持iTunes文件共享支持就地打开文档如下图

enter image description here

自从更新到 iOS 13 后,以前在 iOS 12 中显示的同一个文件夹不再显示。

iOS 13 发生了什么变化,我该如何解决这个问题?

我使用下面的扩展来保存文件:

extension WebViewController:  URLSessionDownloadDelegate {
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) {

// create destination URL with the original pdf name
guard let url = downloadTask.originalRequest?.url else { return }
let documentsPath = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
let destinationURL = documentsPath.appendingPathComponent(url.lastPathComponent)
// delete original copy
try? FileManager.default.removeItem(at: destinationURL)
// copy from temp to Document
do {
try FileManager.default.copyItem(at: location, to: destinationURL)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2){
let activityViewController = UIActivityViewController(activityItems: [self.fileName, destinationURL], applicationActivities: nil)
if(UIDevice.current.userInterfaceIdiom == .pad){
if let popOver = activityViewController.popoverPresentationController {
popOver.sourceView = self.view
popOver.sourceRect = self.view.bounds
popOver.barButtonItem = self.navigationItem.rightBarButtonItem
self.present(activityViewController, animated: true, completion: nil)
}
}
else{
self.present(activityViewController, animated: true, completion: nil)
}
}
} catch let error {
print("Copy Error: \(error.localizedDescription)")
}
}
}

最佳答案

对于那些寻找上述特定问题的答案的人,

更新到 iOS 13.1 似乎解决了这个问题,所以我不确定这是否是某种错误

关于ios - 在我的 iPhone 文件夹中,如何为我的应用创建文件夹? [iOS 13],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58125994/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com