IosModelDownloadDelegate
private class IosModelDownloadDelegate(val destinationPath: String, val onProgress: (Int) -> Unit, val onBytesReceived: (Long) -> Unit, val onComplete: (Result<Unit>) -> Unit) : NSObject, NSURLSessionDownloadDelegateProtocol(source)
NSURLSession delegate that converts native progress callbacks into app download state callbacks.
Author
Dmitriy Moroz
Parameters
destinationPath
Temporary destination where NSURLSession output is moved before finalization.
onProgress
Emits integer percent progress when iOS reports total expected byte count.
onBytesReceived
Emits every positive byte delta for traffic statistics.
onComplete
Completes the callbackFlow with success or a user-visible download error.
Constructors
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect open override fun performSelector(aSelector: COpaquePointer?, withObject: Any?, _withObject: Any?): Any?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL: NSURL)
open override fun URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError: NSError?)
open override fun URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didWriteData: Long, totalBytesWritten: Long, totalBytesExpectedToWrite: Long)
expect open fun URLSession(session: NSURLSession, didReceiveChallenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Unit)
expect open fun URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didResumeAtOffset: int64_t, expectedTotalBytes: int64_t)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStream: (NSInputStream?) -> Unit)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveInformationalResponse: NSHTTPURLResponse)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, didFinishCollectingMetrics: NSURLSessionTaskMetrics)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStreamFromOffset: int64_t, completionHandler: (NSInputStream?) -> Unit)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Unit)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, willBeginDelayedRequest: NSURLRequest, completionHandler: (NSURLSessionDelayedRequestDisposition, NSURLRequest?) -> Unit)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, didSendBodyData: int64_t, totalBytesSent: int64_t, totalBytesExpectedToSend: int64_t)
expect open fun URLSession(session: NSURLSession, task: NSURLSessionTask, willPerformHTTPRedirection: NSHTTPURLResponse, newRequest: NSURLRequest, completionHandler: (NSURLRequest?) -> Unit)
Link copied to clipboard