Skip to content

一行代码显示当前时间 支持UITableViewCell各自倒计时,支持滑动 支持后台倒计时

License

Notifications You must be signed in to change notification settings

MQL9011/MqlClock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 22, 2018
02b617b · Oct 22, 2018

History

76 Commits
Oct 22, 2018
Oct 22, 2018
Oct 22, 2018
Jun 17, 2017
May 19, 2017
Apr 17, 2017
Oct 22, 2018
Oct 22, 2018

Repository files navigation

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

About

一行代码显示当前时间 支持UITableViewCell各自倒计时,支持滑动 支持后台倒计时

Resources

License

Stars

Watchers

Forks

Packages

No packages published