I am using NSURLSession's dataTaskWithRequest
to download data to my app.
Currently I show an activity view overlay on my view controller when my app downloads data from web server.
My user requested me to show a custom animation that tracks the execution completion of download process.
I know that dataTaskWithRequest
is asynchronous
and executes in background thread
. I also know that I can NSURLSessionDelegate
method
func URLSession(session: NSURLSession, task: NSURLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) {}
to track progress of data being uploaded. So, I was wondering if there is any way to assign a progress view for download activity.
Any suggestions would be helpful. Thanks.