All Projects → shaojiankui → Jkcountdownbutton

shaojiankui / Jkcountdownbutton

Licence: mit
JKCountDownButton,子类化UIButton实现IOS倒计时按钮,常常用于注册等发送验证码的时候进行倒计时操作

Labels

Projects that are alternatives of or similar to Jkcountdownbutton

CountdownView
Simple countdown view with custom animations
Stars: ✭ 70 (-83.94%)
Mutual labels:  countdown
yii2-time-down-counter
Widget for yii2, to start count down timer with a lot of options, This widget build dependence of timeDownCounter JS library
Stars: ✭ 15 (-96.56%)
Mutual labels:  countdown
Timer.jquery
jQuery Timer: Start/Stop/Resume/Remove pretty timer inside any HTML element.
Stars: ✭ 283 (-35.09%)
Mutual labels:  countdown
nypsi
the best discord bot
Stars: ✭ 41 (-90.6%)
Mutual labels:  countdown
tiktok
🕑 A countdown chrome extension for tasks/events/whatever.
Stars: ✭ 22 (-94.95%)
Mutual labels:  countdown
Web-Time-Tracker
Plugin named Timetracker is a time counter that works in both increase and decrease directions.
Stars: ✭ 21 (-95.18%)
Mutual labels:  countdown
countdown
jQuery CountDown Clock - Simple countdown plugin for product special offers
Stars: ✭ 33 (-92.43%)
Mutual labels:  countdown
Vue Countdown
Countdown component for Vue.js.
Stars: ✭ 393 (-9.86%)
Mutual labels:  countdown
react-component-countdown-timer
This is a simple count down timer react component.
Stars: ✭ 18 (-95.87%)
Mutual labels:  countdown
Countdownview
Android Countdown View
Stars: ✭ 2,869 (+558.03%)
Mutual labels:  countdown
vue-flip-down
vue 翻页倒计时组件 妙啊
Stars: ✭ 90 (-79.36%)
Mutual labels:  countdown
alfred-timer-workflow
Alfred workflow to start a timer, which blinks when the time is up.
Stars: ✭ 39 (-91.06%)
Mutual labels:  countdown
ZXCountDownView
【杀不死的倒计时】一个简单易用的倒计时View,常用于快速创建点击获取验证码按钮,支持各种自定义样式。(特点:重新进入当前页面或重启程序倒计时不会重置,仍将继续执行,且退出程序后的时间也会被自动计算在内)
Stars: ✭ 56 (-87.16%)
Mutual labels:  countdown
osx-statusbar-countdown
⏳📅 A utility to count down to a date from your macOS menubar, written in Swift
Stars: ✭ 40 (-90.83%)
Mutual labels:  countdown
Efcountinglabel
Adds animated counting support to UILabel.
Stars: ✭ 311 (-28.67%)
Mutual labels:  countdown
timeleft
⏳ Don't waste your time or time will waste you! ☠️ One tends to consume time on low-return stuff, superficial entertainment. 📺 Things they don't actually want to do. One should make the most of his time. ⏱ Get busy living.
Stars: ✭ 18 (-95.87%)
Mutual labels:  countdown
moveit
Move.it is a project that combines the pomodoro (🍅 ) technique with some challenges (⚔️ ) for the well-being (🥰 ) of those who spend many hours (⏳ ) using the computer 🖥
Stars: ✭ 12 (-97.25%)
Mutual labels:  countdown
React Countdown
A customizable countdown component for React.
Stars: ✭ 402 (-7.8%)
Mutual labels:  countdown
Oycountdownmanager
在cell中使用倒计时的处理方法, 全局使用一个NSTimer对象, 支持单列表.多列表.多页面.分页列表使用
Stars: ✭ 317 (-27.29%)
Mutual labels:  countdown
ClassClock
ClassClock is a free, easy-to-use web app for K-12 schools that provides an at-a-glance view of the school schedule
Stars: ✭ 27 (-93.81%)
Mutual labels:  countdown

JKCountDownButton

JKCountDownButton,子类化UIButton实现IOS倒计时按钮,常常用于注册等发送验证码的时候进行倒计时操作

JKCountDownButton, subclassing UIButton implementation iOS countdown button, register with sending the verification code and countdown

Installation

Installation with CocoaPods

platform :ios
pod 'JKCountDownButton'

Manually

Copy JKCountDownButton.h JKCountDownButton.m in JKCountDownButton/ to your project.

Usage

Code

JKCountDownButton *_countDownCode;
_countDownCode = [JKCountDownButton buttonWithType:UIButtonTypeCustom];
_countDownCode.frame = CGRectMake(81, 200, 108, 32);
[_countDownCode setTitle:@"开始" forState:UIControlStateNormal];
_countDownCode.backgroundColor = [UIColor blueColor];
[self.view addSubview:_countDownCode];

 [_countDownCode countDownButtonHandler:^(JKCountDownButton*sender, NSInteger tag) {
    sender.enabled = NO;

    [sender startCountDownWithSecond:10];

    [sender countDownChanging:^NSString *(JKCountDownButton *countDownButton,NSUInteger second) {
        NSString *title = [NSString stringWithFormat:@"剩余%zd秒",second];
        return title;
    }];
    [sender countDownFinished:^NSString *(JKCountDownButton *countDownButton, NSUInteger second) {
        countDownButton.enabled = YES;
        return @"点击重新获取";
        
    }];

}];

###xib @property (weak, nonatomic) IBOutlet JKCountDownButton *countDownXib;

- (IBAction)countDownXibTouched:(JKCountDownButton*)sender {
sender.enabled = NO;
//button type要 设置成custom 否则会闪动
[sender startCountDownWithSecond:60];

[sender countDownChanging:^NSString *(JKCountDownButton *countDownButton,NSUInteger second) {
    NSString *title = [NSString stringWithFormat:@"剩余%zd秒",second];
    return title;
}];
[sender countDownFinished:^NSString *(JKCountDownButton *countDownButton, NSUInteger second) {
    countDownButton.enabled = YES;
    return @"点击重新获取";
    
}];

}

License

This code is distributed under the terms and conditions of the MIT license.

Demo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].