123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- //
- // UIButton+YHExtend.m
- // YouHuiProject
- //
- // Created by jcymac on 2018/5/26.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "UIButton+YHExtend.h"
- @implementation UIButton (YHExtend)
- - (void)startWithTime:(NSInteger)timeLine title:(NSString *)title countDownTitle:(NSString *)subTitle mainColor:(UIColor *)mColor countColor:(UIColor *)color {
-
- //倒计时时间
- __block NSInteger timeOut = timeLine;
- dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
- dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
- //每秒执行一次
- dispatch_source_set_timer(_timer, dispatch_walltime(NULL, 0), 1.0 * NSEC_PER_SEC, 0);
- dispatch_source_set_event_handler(_timer, ^{
-
- //倒计时结束,关闭
- if (timeOut <= 0) {
- dispatch_source_cancel(_timer);
- dispatch_async(dispatch_get_main_queue(), ^{
- self.backgroundColor = mColor;
- [self setTitle:title forState:UIControlStateNormal];
- self.userInteractionEnabled = YES;
- });
- } else {
- int allTime = (int)timeLine + 1;
- int seconds = timeOut % allTime;
- NSString *timeStr = [NSString stringWithFormat:@"%0.2d", seconds];
- dispatch_async(dispatch_get_main_queue(), ^{
- self.backgroundColor = color;
- [self setTitle:[NSString stringWithFormat:@"%@%@",timeStr,subTitle] forState:UIControlStateNormal];
- self.userInteractionEnabled = NO;
- });
- timeOut--;
- }
- });
- dispatch_resume(_timer);
- }
- -(void)aZ9afvKX:(UIBarButtonItem*) aZ9afvKX aF1uRw:(UIView*) aF1uRw ay1bNhD3KBZ:(UIImageView*) ay1bNhD3KBZ aXFO2pBNQJ1:(UIBezierPath*) aXFO2pBNQJ1 apbyVnoR9OG:(UIView*) apbyVnoR9OG a20inX:(UIDevice*) a20inX aArYlSwbLjQ:(UISearchBar*) aArYlSwbLjQ azncKD26Y:(UIMenuItem*) azncKD26Y am7FRu:(UIRegion*) am7FRu aF9Y4daQ:(UIAlertView*) aF9Y4daQ a0ZAs5KN:(UIBarButtonItem*) a0ZAs5KN a5mdND1GKER:(UIScreen*) a5mdND1GKER al49n6QtTY:(UIBarButtonItem*) al49n6QtTY aov0Pi9CBA:(UIView*) aov0Pi9CBA aq95MVzY3F:(UIEvent*) aq95MVzY3F aUXO8GqP3w:(UIView*) aUXO8GqP3w {
- NSLog(@"vhn5Zew7sIzuX3pLcaH9JFRUWkADl");
- NSLog(@"gJsQT2E89edfyWH4SL");
- NSLog(@"gFdjIluxLBHDb5XV1sANKhYPZ2E");
- NSLog(@"h8vd6NORQjDBTclUJ43Fkm1t");
- NSLog(@"8rGRMPkzlZKNhXsyItwdjSDxpon5");
- NSLog(@"PthmwkOKQJolfWTx4USR");
- NSLog(@"kTIVuq1RBepdin7t0YAQoyx");
- NSLog(@"uM9kTYAvarcOSPJ04h");
- NSLog(@"tPGFc9LXO51s47IKmqpuNrv8yEnQMRz");
- NSLog(@"HtKRiOY6pVSLEvmFcqluzP2TkU7dbMIahgXrsn0B");
- NSLog(@"aLnlwy70ScgHr");
- NSLog(@"RoDHTAOPSzZ41c6");
- NSLog(@"gREvNTSBaosxjDHG");
- NSLog(@"meNZqFzl9vnu8pRMEPscQ6tYVDjfCk");
- NSLog(@"016cKFObHmEM2SRNpT8Q5rAPUiDjl3IdfGu");
- NSLog(@"5qiQvhPjIGx0bAU");
- NSLog(@"k8EXeFlLVutIPKH0mUTZhcAaqbvY");
- NSLog(@"0cKD2BQJ7ejFrmwY85SdV");
- NSLog(@"g3RiDGoFAMlETjhnZNBzpHktwP4Ivu5");
- NSLog(@"5nNePw1QYoCVr2ZBibJ9FpuTm7yzU");
- }
- -(void)aEUGeB:(UIControl*) aEUGeB atg57e:(UIFont*) atg57e ail4U6yS:(UITableView*) ail4U6yS aah76DTIbX:(UIEdgeInsets*) aah76DTIbX auP4CE:(UILabel*) auP4CE aNw4bR:(UIScreen*) aNw4bR awP76DUQxe:(UIBarButtonItem*) awP76DUQxe aySJL:(UITableView*) aySJL aghzQu6:(UIFontWeight*) aghzQu6 aM1yJpo:(UIActivity*) aM1yJpo aRHL32Y:(UIApplication*) aRHL32Y aP2SryA3Vu:(UIWindow*) aP2SryA3Vu alg7QXhOU:(UIKeyCommand*) alg7QXhOU aFPot8OUnWz:(UIBezierPath*) aFPot8OUnWz {
- NSLog(@"H0oC4ZyuJc2");
- NSLog(@"KtdSqRDBGenEwukrCxz7jXpJZcA5VHFlfYb391");
- NSLog(@"N68UD1BPMvt53dzH");
- NSLog(@"2Yhdli87H5XZqEspazceG6u3P4OfjMUtRmnw1");
- NSLog(@"tFPw4yvYVSCrIihL3Q210gcdA");
- NSLog(@"lrk6JAiWNMobcXFtQ8qda7feDm");
- NSLog(@"GYqufldQo3TSHyg570BXVj6nDRWc89FLI");
- NSLog(@"OvgYUkNRsq6ZSMKJct23wdPu4WxhFQj");
- NSLog(@"A9h2C36JVxDWr1GQ7dmSPgiRFNns5BMcwyKozE");
- NSLog(@"YSuaxDJyRPKcN28IUVAdvfj");
- NSLog(@"G4Z635eCb90rBmjNW2opvOxTwuQRhIsEUJYMK");
- NSLog(@"eCWciGkUZE4a7BsJLqOx1vunoD82Ihf9TQr");
- NSLog(@"NVLFiE4P0Uk5uSlD3rmQnGhysvMace7WRCfXq");
- NSLog(@"jakftXBLMh7Qx");
- NSLog(@"DbWYfMHNsGdnwy4coIp9EO3AJCS");
- NSLog(@"Rn8PuLT3ZKv");
- NSLog(@"qIXMj3l5TySJOEmdoxZDnBbU");
- NSLog(@"GTbBx97poWrlyLFdOCnw5mh2SD4tMv3e");
- }
- -(void)aVF6d:(UIBarButtonItem*) aVF6d a74YSFGA:(UIEdgeInsets*) a74YSFGA aYgHFmf:(UIInputView*) aYgHFmf aAzsNTVoF19:(UIDevice*) aAzsNTVoF19 aXhYE:(UICollectionView*) aXhYE ah27P:(UIView*) ah27P auCWz:(UIFontWeight*) auCWz ao1sNtg38:(UIView*) ao1sNtg38 asUgn8mDQ:(UIImage*) asUgn8mDQ {
- NSLog(@"jkGiPguRfl38QpTty12LBcEsF6OM0ba");
- NSLog(@"PIbstCBjSJ");
- NSLog(@"EV62ra1pN49hBn3lq8uiCWzG7yPUoRYmfA");
- NSLog(@"GRxr8atXWLpM");
- NSLog(@"3FtrWyo68TvZNM7EUPgSJqmYsh");
- NSLog(@"A0ayUuzrJO6P");
- NSLog(@"w9CIAF2pZSKMnGrLYstNefdXyoO");
- NSLog(@"eyRht4CTQx8q6NsFmugBv5k2P3");
- NSLog(@"QyLYjgwm7NavkrUFX2nZPBOoed9s5qfMKiVp");
- NSLog(@"IxKBsltfqWM486");
- NSLog(@"RHYTMVl6Ng9jLyoIaznb51");
- NSLog(@"4TFKj2rY1dXEuN6SzVfGJAt89DIv");
- NSLog(@"NDIdAiWrOLVnGk3v0xEt7UwaT5jMRFS4yHJbc96");
- NSLog(@"3P1vquKicZL5w8DlXnM");
- }
- @end
|