iOS 的 HTTP 返回字段
response.expectedContentLength
对应要下载的文件大小
extension Downloader: URLSessionDataDelegate {
public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
os_log("%@ - %d", log: Downloader.logger, type: .debug, #function, #line)
totalBytesCount = response.expectedContentLength
completionHandler(.allow)
}
}
3741

被折叠的 条评论
为什么被折叠?



