NSURLSessionDataTask show loading overlay

89 views Asked by At

How to make a loading overlay with a spinner when doing async task with NSURLSessionDataTask?

1

There are 1 answers

0
Michael Dautermann On BEST ANSWER

Your NSURLSessionDataTask has a delegate object you designate to which it will send periodic messages to inform the delegate of what's happening in the asynchronous task. Perhaps you'll set that delegate to be the view controller that the user sees while the task is going on.

If this were my code, I'd probably have my view controller display a hidden UIView containing an animated spinner the first time [URLSession:dataTask:didBecomeDownloadTask:] is called, as the download is starting up.