forked from nashibao/na_ios_network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNANetworkActivityIndicatorManager.h
43 lines (27 loc) · 1.25 KB
/
NANetworkActivityIndicatorManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#import <Foundation/Foundation.h>
#import <Availability.h>
#import "SVProgressHUD.h"
@interface NANetworkActivityIndicatorActivityObject : NSObject
@property (strong, nonatomic) NSString *identifier;
@property (nonatomic) NSInteger activityCount;
@property (strong, nonatomic) NSMutableArray *errors;
@end
/** indicator manager
*/
@interface NANetworkActivityIndicatorManager : NSObject
/** enable option : default = YES */
@property (nonatomic, assign, getter = isEnabled) BOOL enabled;
/** getter. to be YES when network count > 0 */
@property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible;
/** error array.
*/
@property (strong, nonatomic) NSMutableArray *errors;
@property (strong, nonatomic) NSMutableDictionary *activityObjectWithIdentifiers;
@property (nonatomic) BOOL enableSVProgress;
@property (nonatomic) SVProgressHUDMaskType defaultSVProgressHUDMaskType;
+ (NANetworkActivityIndicatorManager *)sharedManager;
- (void)incrementActivityCount:(NSString *)identifier option:(NSDictionary *)option;
- (void)decrementActivityCount:(NSString *)identifier;
- (void)decrementActivityCount:(NSString *)identifier error:(NSString *)error;
- (void)insert:(NSString *)identifier error:(NSString *)error option:(NSDictionary *)option;
@end