效果图
制作成gif之后,帧率变快了,看起来很别扭,实际上是每秒执行一次的
.h 文件
@interface CountDownView : UIView
@property (nonatomic, assign) long long time;
@property (nonatomic, assign, readonly) long long remainTime;
@end
@interface CountDownLabel : UIView
@property (nonatomic, assign) CATransitionSubtype subtype;
@property (nonatomic, copy) NSString *text;
@end
.m 文件
#import "CountDownView.h"
@interface CountDownView ()
@property (nonatomic, strong) CountDownLabel *hourLabel1;
@property (nonatomic, strong) CountDownLabel *hourLabel2;
@property (nonatomic, strong) UIImageView *dot1;
@property (nonatomic, strong) CountDownLabel *minuteLabel1;
@property (nonatomic, strong) CountDownLabel *minuteLabel2;