How can I see the download progress on Linux?
I tried URLSessionDataDelegate and URLSessionDownloadDelegate, both don't work.
public class SimpleJsonNetworkFetching: NSObject & JsonNetworkFetching {//NSObject & JsonNetworkFetching {
public required convenience init(urlConfig: URLSessionConfiguration) {
self.init()
self.session = URLSession(configuration: urlConfig, delegate: self, delegateQueue: nil)
}
}
extension SimpleJsonNetworkFetching: URLSessionDataDelegate, URLSessionDownloadDelegate {
public func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) {
print("urlSession downloadTask")
}
public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) {
print("urlSession didReceive")
}
public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
print("urlSession adding")
}
public func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
print("urlSession error")
}
}
none of the delegating methods are kicked in.