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 ...

Get iOS and OS X Network Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.