我已经实现了 FileProvider 扩展。
class MyProviderExtension: NSFileProviderExtension {
override func startProvidingItem(at url: URL, completionHandler: ((_ error: Error?) -> Void)?) {
downloading file using URL and implemented download delegates
// Download Delegate
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) {
**// How can I upload the download progress here.**
}
}
}
我无法在下载代表中获取任何 UI 处理程序来更新进度并在成功下载后更新单元格下载按钮。