CJJTimer
简单好用的定时器封装(短信、商品秒杀倒计时)(持续迭代)
优点:高性能,自动管理内存,自动释放,高定制化,易用(支持链式语法调用)
注:目前依赖于第三方布局库Masonry
使用方法
手动管理
下载 demo,直接将 demo 里的文件夹 CJJTimer 拖入您的项目中即可
CocoaPods 管理(目前最新版本为 1.0.9)
pod 'CJJTimer'
下面的图示是 demo 所呈现的几种效果,还有更多效果等着您来定制~
支持链式语法调用
- (CJJTimerView *)timer{
if(!_timer){
CJJTimerViewConfiguration *configuration = [CJJTimerViewConfiguration configureTimerView];
configuration.viewWidth(18)
.viewHeight(18)
.hiddenWhenFinished(NO)
.lastTime([NSString stringWithFormat:@"%ld",[self getNowTimeTimeStampSec].integerValue+10])
.cornerRadius(3)
.backgroundColor([UIColor colorWithRed:238/255.0 green:39/255.0 blue:5/255.0 alpha:1])
.textLabelFont([UIFont systemFontOfSize:11 weight:UIFontWeightBold])
.textLabelColor([UIColor whiteColor])
.colonLabelFont([UIFont systemFontOfSize:11 weight:UIFontWeightBold])
.colonLabelColor([UIColor colorWithRed:238/255.0 green:39/255.0 blue:5/255.0 alpha:1]);
_timer = [CJJTimerView timerViewWithConfiguration:configuration];
_timer.delegate = self;
}
return _timer;
}