MRProgress 0.6.0
Summary
This version includes optional AFNetworking 2.0 support and a bug fix UIAppearance support.
It doesn't install anymore some subspecs by default, which are not required.
AFNetworking Usage
-
Include the following additional line into your Podfile:
pod 'MRProgress/AFNetworking'
-
Import the adequate category header for the component you want to use:
import <MRProgress/MRProgressOverlayView+AFNetworking.h>
-
You can now just setup your task / operation as usual and use the category
methods to bind to execution state and progress as shown below.// Init the progress overlay as usual MRProgressOverlayView *overlayView overlayView = [MRProgressOverlayView showOverlayAddedTo:self.view animated:YES]; // The following line will do these things automatically: // * Set mode to determinate when a download or upload is in progress // * Set animated progress of the download or upload // * Show a checkmark or cross pane at the end of the progress [overlayView setModeAndProgressWithStateOfTask:task]; // Allows the user to cancel the task by using the provided stop button. // If you use that, make sure that you handle the error code, which will be // delivered to the failure block of the task like shown below: // // if ([error.domain isEqualToString:NSURLErrorDomain] // && error.code == NSURLErrorCancelled) { // NSLog(@"Task was cancelled by user."); // return; // } // [overlayView setStopBlockForTask:task]; // If you use the activity indicator directly [self.activityIndicatorView setAnimatingWithStateOfTask:task]; // If you use one of the progress views directly ... // ... for uploads: [self.circularProgressView setProgressWithUploadProgressOfTask:downloadTask animated:YES]; // ... for downloads: [self.circularProgressView setProgressWithDownloadProgressOfTask:downloadTask animated:YES]; [[MRNavigationBarProgressView progressViewForNavigationController:self.navigationController] setProgressWithDownloadProgressOfTask:downloadTask animated:YES];
All methods are available for both
NSURLSessionTask
andAFURLConnectionOperation
and their descendants.
For further examples, make sure to also checkout the Example app.
Changelog
- AFNetworking support. See above or the README for how to get it. (#25, #50)
- Fixed bug in UIAppearance support. (#48, #52)
- Make some subspecs optional, and not installed by default. This includes beside the new
MRProgress/AFNetworking
the following specs:MRProgress/MessageInterceptor
andMRProgress/WeakProxy
. If you relied implicitly on them, make sure to include them in your Podfile explicitly now.