一行代码显示当前时间 支持UITableViewCell各自倒计时,支持滑动 支持后台倒计时
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
MCDemo
MCSourceCode
MqlClock
.gitignore
DJS.png
LICENSE
MqlClock.podspec
README.md

README.md

MqlClock

Description

Line of code shows the current time
Countdown based on runTime interface
support UITableViewCell their respective countdown, support sliding
Supports background countdown


一行代码显示当前时间
基于runTime接口的倒计时
支持UITableViewCell各自倒计时,支持滑动
支持后台倒计时
支持暂停重置

DJS.png

Install

The podfile

pod 'MqlClock'
pod install

How to Use

import

#import "MqlClock.h"

Init The clock

 self.mc = [MqlClock sharedMqlClock];
 self.mc.delegate = self;
 self.mc.dateFormat = @"yyyy-MM-dd HH:mm:ss";

delegate

@interface ViewController ()<MqlClockDelegate>

2017-04-25 10:45:57 星期二

- (void)showTheTimeNow:(NSString *)nowTime{
    self.timeLable.text = nowTime;

}

UIButton countdown 10.9.8.7...

- (void)countDown:(NSString *)cdTimer{
    [self.countDownBtn setTitle:[NSString stringWithFormat:@"倒计时%@",cdTimer] forState:UIControlStateNormal];
}

Change the display format 2017/05/11 18:09:12

self.mc.dateFormat = @"yyyy/MM/dd HH:mm:ss";

UITableViewCell CountDown

#import "UITableViewCell+MqlClock.h"

- (void)runCountDown{
    [self runCADisplayLinkTimer];
}

- (void)showTheCountDownTime:(NSString *)time{
    self.timeLable.text = time;
}

Set tableViewCell start CountDown second

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    //here is your cell
    cell.mcStartSecond = [NSString stringWithFormat:@"%ld",(indexPath.row * 10 + 10)];
    return cell;
}

License

MIT