BBACountingLabel.h
1.34 KB
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
//
// BBACountingLabel.h
// BBAUIKit
//
// Created by chenjia09 on 2018/12/24.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, BBALabelCountingMethod) {
BBALabelCountingMethodEaseInOut,
BBALabelCountingMethodEaseIn,
BBALabelCountingMethodEaseOut,
BBALabelCountingMethodLinear
};
typedef NSString* (^BBACountingLabelFormatBlock)(CGFloat value);
typedef NSAttributedString* (^BBACountingLabelAttributedFormatBlock)(CGFloat value);
@interface BBACountingLabel : UILabel
@property (nonatomic, strong) NSString *format;
@property (nonatomic, assign) BBALabelCountingMethod method;
@property (nonatomic, assign) NSTimeInterval animationDuration;
@property (nonatomic, copy) BBACountingLabelFormatBlock formatBlock;
@property (nonatomic, copy) BBACountingLabelAttributedFormatBlock attributedFormatBlock;
@property (nonatomic, copy) void (^completionBlock)(void);
-(void)countFrom:(CGFloat)startValue to:(CGFloat)endValue;
-(void)countFrom:(CGFloat)startValue to:(CGFloat)endValue withDuration:(NSTimeInterval)duration;
-(void)countFromCurrentValueTo:(CGFloat)endValue;
-(void)countFromCurrentValueTo:(CGFloat)endValue withDuration:(NSTimeInterval)duration;
-(void)countFromZeroTo:(CGFloat)endValue;
-(void)countFromZeroTo:(CGFloat)endValue withDuration:(NSTimeInterval)duration;
- (CGFloat)currentValue;
@end