Previous episode: 11. Using Asynchronous Methods in Views
Next episode: 13. Downloading Chunks
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Download View has a boolean state property is Download Active. It passes a binding to this property to file details, where the value controls the display of a progress view, a spinning activity indicator next to the file name. Your challenge is to show this progress view when the download starts and hide it when the download finishes. Be sure to also hide the progress view, if the download task throws an error. You only need to add a few lines of code to the download single action definition. In the task closure, you'll need a due catch block to handle the error case. Good luck. (upbeat pop music) Welcome back. Hopefully you had success with this task. Here's how I did it. In the download single action definition, I added this code before task. This gets the spinner spinning. In the task closure, I replace the single line of code with this. Whether or not there's a download error, I set is download active to false, build and run. Select the jpeg file, and tap silver. And there was your activity indicator. Well done. You've implemented the silver plan. In the next episode, you'll start work on the gold plan.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.