commit | author | age
|
6e1425
|
1 |
// UIProgressView+AFNetworking.h |
H |
2 |
// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) |
|
3 |
// |
|
4 |
// Permission is hereby granted, free of charge, to any person obtaining a copy |
|
5 |
// of this software and associated documentation files (the "Software"), to deal |
|
6 |
// in the Software without restriction, including without limitation the rights |
|
7 |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
8 |
// copies of the Software, and to permit persons to whom the Software is |
|
9 |
// furnished to do so, subject to the following conditions: |
|
10 |
// |
|
11 |
// The above copyright notice and this permission notice shall be included in |
|
12 |
// all copies or substantial portions of the Software. |
|
13 |
// |
|
14 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
15 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
16 |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
17 |
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
18 |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
19 |
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
20 |
// THE SOFTWARE. |
|
21 |
|
|
22 |
#import <Foundation/Foundation.h> |
|
23 |
|
|
24 |
#import <Availability.h> |
|
25 |
|
|
26 |
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) |
|
27 |
|
|
28 |
#import <UIKit/UIKit.h> |
|
29 |
|
|
30 |
NS_ASSUME_NONNULL_BEGIN |
|
31 |
|
|
32 |
@class AFURLConnectionOperation; |
|
33 |
|
|
34 |
/** |
|
35 |
This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task or request operation. |
|
36 |
*/ |
|
37 |
@interface UIProgressView (AFNetworking) |
|
38 |
|
|
39 |
///------------------------------------ |
|
40 |
/// @name Setting Session Task Progress |
|
41 |
///------------------------------------ |
|
42 |
|
|
43 |
/** |
|
44 |
Binds the progress to the upload progress of the specified session task. |
|
45 |
|
|
46 |
@param task The session task. |
|
47 |
@param animated `YES` if the change should be animated, `NO` if the change should happen immediately. |
|
48 |
*/ |
|
49 |
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 |
|
50 |
- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task |
|
51 |
animated:(BOOL)animated; |
|
52 |
#endif |
|
53 |
|
|
54 |
/** |
|
55 |
Binds the progress to the download progress of the specified session task. |
|
56 |
|
|
57 |
@param task The session task. |
|
58 |
@param animated `YES` if the change should be animated, `NO` if the change should happen immediately. |
|
59 |
*/ |
|
60 |
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 |
|
61 |
- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task |
|
62 |
animated:(BOOL)animated; |
|
63 |
#endif |
|
64 |
|
|
65 |
///------------------------------------ |
|
66 |
/// @name Setting Session Task Progress |
|
67 |
///------------------------------------ |
|
68 |
|
|
69 |
/** |
|
70 |
Binds the progress to the upload progress of the specified request operation. |
|
71 |
|
|
72 |
@param operation The request operation. |
|
73 |
@param animated `YES` if the change should be animated, `NO` if the change should happen immediately. |
|
74 |
*/ |
|
75 |
- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation |
|
76 |
animated:(BOOL)animated; |
|
77 |
|
|
78 |
/** |
|
79 |
Binds the progress to the download progress of the specified request operation. |
|
80 |
|
|
81 |
@param operation The request operation. |
|
82 |
@param animated `YES` if the change should be animated, `NO` if the change should happen immediately. |
|
83 |
*/ |
|
84 |
- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation |
|
85 |
animated:(BOOL)animated; |
|
86 |
|
|
87 |
@end |
|
88 |
|
|
89 |
NS_ASSUME_NONNULL_END |
|
90 |
|
|
91 |
#endif |