O'Reilly logo

iOS and OS X Network Programming Cookbook by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a progress bar to upload or download

When we have a large upload or download, we generally want to have a progress indicator that we can show to the users so that they have an idea of how much longer the upload or download will take. The MKNetworkKit makes showing a progress indicator incredibly easy.

In this recipe we will be adding a progress indicator that will show the progress of downloading a large file. We will be using the onDownloadProgressChanged: callback of the MKNetworkOperation class to track the progress of our download. If we want the progress indicator to work for an upload, we need to use the onUploadProgressChanged: callback.

Getting ready

This recipe is compatible with both iOS and OS X. We need to download the framework ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required