-
Notifications
You must be signed in to change notification settings - Fork 1
/
PDKTProgress.h
52 lines (43 loc) · 1.61 KB
/
PDKTProgress.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
44
45
46
47
48
49
50
51
52
//
// THProgressHandler.h
// Thoughts
//
// Created by Daniel García García on 6/2/15.
// Copyright (c) 2015 Produkt. All rights reserved.
//
#import <UIKit/UIKit.h>
@class PDKTProgress;
@protocol PDKTProgressObserver <NSObject>
NS_ASSUME_NONNULL_BEGIN
- (void)progressHandler:(PDKTProgress *)progressHandler didUpdateProgress:(CGFloat)progress;
NS_ASSUME_NONNULL_END
@end
@interface PDKTProgress : NSObject
NS_ASSUME_NONNULL_BEGIN
@property (copy,nonatomic) NSString *identifier;
@property (assign,nonatomic) CGFloat progress;
@property (nullable, strong,nonatomic) NSTimer *fakeProgressTimer;
@property (assign,nonatomic,readonly) CGFloat fakeProgressLimit;
@property (assign,nonatomic,readonly) CGFloat fakeProgressIncrement;
@property (copy, readonly) NSDictionary *userInfo;
- (void)reset;
- (void)startFakeProgressUntil:(CGFloat)progressLimit withDuration:(NSTimeInterval)progressDuration;
- (void)updateFakeProgress;
- (void)setUserInfoObject:(nullable id)objectOrNil forKey:(nonnull NSString *)key;
NS_ASSUME_NONNULL_END
@end
@interface PDKTProgress (Observer)<PDKTProgressObserver>
NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,readonly) NSArray *observers;
- (void)addObserver:(id<PDKTProgressObserver>)observer;
- (void)removeObserver:(id<PDKTProgressObserver>)observer;
NS_ASSUME_NONNULL_END
@end
@interface PDKTProgress (Subprogress)
NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,readonly) NSArray *subprogresses;
- (void)addSubprogress:(PDKTProgress *)subprogress;
- (void)addSubprogress:(PDKTProgress *)subprogress withWeight:(CGFloat)weight;
- (void)removeSubprogress:(PDKTProgress *)subprogress;
NS_ASSUME_NONNULL_END
@end