Commit bcdb81c9 authored by 曹云霄's avatar 曹云霄

优化代码

parent 634825aa
...@@ -43,11 +43,10 @@ ...@@ -43,11 +43,10 @@
MWPhoto *photo = [MWPhoto photoWithURL:[NSURL URLWithString:att.fileUrl]]; MWPhoto *photo = [MWPhoto photoWithURL:[NSURL URLWithString:att.fileUrl]];
[self.browserArray addObject:photo]; [self.browserArray addObject:photo];
} }
#warning 待修改
MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self]; MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
[browser setCurrentPhotoIndex:tap.view.tag]; [browser setCurrentPhotoIndex:tap.view.tag];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:browser]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:browser];
// [self.viewController.navigationController presentViewController:nav animated:YES completion:nil]; [self.viewController.navigationController presentViewController:nav animated:YES completion:nil];
} }
#pragma mark - <MWPhotoBrowserDelegate> #pragma mark - <MWPhotoBrowserDelegate>
......
...@@ -90,8 +90,7 @@ typedef NS_ENUM(NSInteger, ItemIndex) { ...@@ -90,8 +90,7 @@ typedef NS_ENUM(NSInteger, ItemIndex) {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[camera setSourceType:UIImagePickerControllerSourceTypeCamera]; [camera setSourceType:UIImagePickerControllerSourceTypeCamera];
camera.allowsEditing = YES; camera.allowsEditing = YES;
#warning 待修改 [self.viewController presentViewController:camera animated:YES completion:nil];
// [self.viewController presentViewController:camera animated:YES completion:nil];
} else { } else {
[XBLoadingView showHUDViewWithText:@"相机无法使用"]; [XBLoadingView showHUDViewWithText:@"相机无法使用"];
} }
...@@ -196,14 +195,7 @@ typedef NS_ENUM(NSInteger, ItemIndex) { ...@@ -196,14 +195,7 @@ typedef NS_ENUM(NSInteger, ItemIndex) {
} }
- (void)selectAlbumImage { - (void)selectAlbumImage {
if (![BaseViewController determinePhotosPermissions]) { if ([BaseViewController determinePhotosPermissions]) {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:@"请在iPad的“设置-隐私-相册”选项中,允许欧立方访问你的相册" preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:nil]];
#warning 待修改
// [self.viewController presentViewController:alertVC animated:YES completion:nil];
return;
}
MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self]; MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
browser.displayActionButton = YES; browser.displayActionButton = YES;
browser.displayNavArrows = YES; browser.displayNavArrows = YES;
...@@ -214,14 +206,12 @@ typedef NS_ENUM(NSInteger, ItemIndex) { ...@@ -214,14 +206,12 @@ typedef NS_ENUM(NSInteger, ItemIndex) {
browser.startOnGrid = YES; browser.startOnGrid = YES;
browser.enableSwipeToDismiss = YES; browser.enableSwipeToDismiss = YES;
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:browser]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:browser];
#warning 待修改 [self.viewController.navigationController presentViewController:nav animated:YES completion:nil];
}
// [self.viewController.navigationController presentViewController:nav animated:YES completion:nil];
} }
- (void)deletePhotoWithIndex:(NSInteger)index { - (void)deletePhotoWithIndex:(NSInteger)index {
UIImage *image = self.arrSelectedPhotos[index]; UIImage *image = self.arrSelectedPhotos[index];
//如果要删除的照片在缓存里面,那么这是相册选择的照片,需要从缓存删除 //如果要删除的照片在缓存里面,那么这是相册选择的照片,需要从缓存删除
for (PHAsset *key in self.cache.allKeys) { for (PHAsset *key in self.cache.allKeys) {
UIImage *cacheImage = [self.cache objectForKey:key]; UIImage *cacheImage = [self.cache objectForKey:key];
...@@ -231,7 +221,6 @@ typedef NS_ENUM(NSInteger, ItemIndex) { ...@@ -231,7 +221,6 @@ typedef NS_ENUM(NSInteger, ItemIndex) {
break; break;
} }
} }
[self.arrSelectedPhotos removeObject:image]; [self.arrSelectedPhotos removeObject:image];
......
...@@ -38,9 +38,6 @@ ...@@ -38,9 +38,6 @@
- (IBAction)actionStartAnswer:(id)sender { - (IBAction)actionStartAnswer:(id)sender {
AssessmentViewController *assessmentVc = [[AssessmentViewController getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"]; AssessmentViewController *assessmentVc = [[AssessmentViewController getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"];
assessmentVc.taskId = _model.fid; assessmentVc.taskId = _model.fid;
// assessmentVc.indexPath = indexPath; [self.viewController.navigationController pushViewController:assessmentVc animated:YES];
// assessmentVc.delegate = weakSelf;
#warning 待修改
// [self.viewController.navigationController pushViewController:assessmentVc animated:YES];
} }
@end @end
...@@ -47,9 +47,6 @@ ...@@ -47,9 +47,6 @@
- (IBAction)actionStartAnswer:(id)sender { - (IBAction)actionStartAnswer:(id)sender {
AssessmentViewController *assessmentVc = [[AssessmentViewController getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"]; AssessmentViewController *assessmentVc = [[AssessmentViewController getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"];
assessmentVc.taskId = _model.fid; assessmentVc.taskId = _model.fid;
// assessmentVc.indexPath = indexPath; [self.viewController.navigationController pushViewController:assessmentVc animated:YES];
// assessmentVc.delegate = weakSelf;
#warning 待修改
// [self.viewController.navigationController pushViewController:assessmentVc animated:YES];
} }
@end @end
...@@ -160,9 +160,8 @@ ...@@ -160,9 +160,8 @@
LoginInfo *login = [[LoginInfo alloc]init]; LoginInfo *login = [[LoginInfo alloc]init];
login.username = self.userName.text; login.username = self.userName.text;
login.password = self.passWord.text; login.password = self.passWord.text;
#warning 待修改 login.username = [login.username formatString];
// login.username = [login.username formatString]; login.password = [login.password formatString];
// login.password = [login.password formatString];
WS(weakSelf); WS(weakSelf);
[HTTP networkRequestWithURL:SERVERREQUESTURL(LOGIN) withRequestType:ZERO withParameter:login withReturnValueBlock:^(id returnValue) { [HTTP networkRequestWithURL:SERVERREQUESTURL(LOGIN) withRequestType:ZERO withParameter:login withReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
...@@ -286,11 +285,10 @@ ...@@ -286,11 +285,10 @@
[XBLoadingView showHUDViewWithText:@"手机号不能为空"]; [XBLoadingView showHUDViewWithText:@"手机号不能为空"];
return; return;
} }
#warning 待修改 if (![inputPhoneNumber isTelephone]) {
// if (![HENLENSONG isValidateMobile:inputPhoneNumber]) { [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];
// [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"]; return;
// return; }
// }
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(SENDSMS),inputPhoneNumber,self.identityView.userName.text]; NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(SENDSMS),inputPhoneNumber,self.identityView.userName.text];
[HTTP networkWithDictionaryRequestWithURL:[self returnUrlString:urlString] withRequestType:ONE withParameter:nil withReturnValueBlock:^(id returnValue) { [HTTP networkWithDictionaryRequestWithURL:[self returnUrlString:urlString] withRequestType:ONE withParameter:nil withReturnValueBlock:^(id returnValue) {
......
...@@ -568,12 +568,11 @@ ...@@ -568,12 +568,11 @@
[XBLoadingView showHUDViewWithText:@"手机号码不能为空"]; [XBLoadingView showHUDViewWithText:@"手机号码不能为空"];
return; return;
} }
#warning 待修改 NSString *phoneNumber = self.phoneNumberField.text;
// NSString *phoneNumber = self.phoneNumberField.text; if (![phoneNumber isTelephone]) {
// if (![HENLENSONG isValidateMobile:phoneNumber]) { [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];
// [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"]; return;
// return; }
// }
if ([BaseViewController isBlankString:self.customerAddress.text]) { if ([BaseViewController isBlankString:self.customerAddress.text]) {
[XBLoadingView showHUDViewWithText:@"地址不能为空"]; [XBLoadingView showHUDViewWithText:@"地址不能为空"];
return; return;
......
...@@ -167,10 +167,9 @@ ...@@ -167,10 +167,9 @@
if ([Shoppersmanager manager].shoppers.employee.isComplete) { if ([Shoppersmanager manager].shoppers.employee.isComplete) {
[self dismissViewControllerAnimated:YES completion:nil];return; [self dismissViewControllerAnimated:YES completion:nil];return;
} }
#warning 待修改 if (![self.informationArray[1][3] isTelephone]) {
// if (![HENLENSONG isValidateMobile:self.informationArray[1][3]]) { [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];return;
// [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];return; }
// }
WS(weakSelf); WS(weakSelf);
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
RsEmployeeRequest *employ = [[RsEmployeeRequest alloc]init]; RsEmployeeRequest *employ = [[RsEmployeeRequest alloc]init];
......
...@@ -92,11 +92,10 @@ ...@@ -92,11 +92,10 @@
[XBLoadingView showHUDViewWithText:@"手机号码不能为空"]; [XBLoadingView showHUDViewWithText:@"手机号码不能为空"];
return; return;
} }
#warning 待修改 if (![phoneNumber isTelephone]) {
// if (![HENLENSONG isValidateMobile:phoneNumber]) { [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];
// [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"]; return;
// return; }
// }
if ([BaseViewController isBlankString:self.detailsAddress.text]) { if ([BaseViewController isBlankString:self.detailsAddress.text]) {
[XBLoadingView showHUDViewWithText:@"请输入详细地址"]; [XBLoadingView showHUDViewWithText:@"请输入详细地址"];
return; return;
......
...@@ -90,10 +90,9 @@ ...@@ -90,10 +90,9 @@
if ([[self class] isBlankString:self.mobileTextField.text]) { if ([[self class] isBlankString:self.mobileTextField.text]) {
[XBLoadingView showHUDViewWithText:@"联系电话不能为空"];return; [XBLoadingView showHUDViewWithText:@"联系电话不能为空"];return;
} }
#warning 待修改 if (![self.mobileTextField.text isTelephone]) {
// if (![HENLENSONG isValidateMobile:self.mobileTextField.text]) { [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];return;
// [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"];return; }
// }
if ([[self class] isBlankString:self.addressButton.currentTitle]) { if ([[self class] isBlankString:self.addressButton.currentTitle]) {
[XBLoadingView showHUDViewWithText:@"地址不能为空"];return; [XBLoadingView showHUDViewWithText:@"地址不能为空"];return;
} }
......
...@@ -85,10 +85,9 @@ ...@@ -85,10 +85,9 @@
if ([self isPureInt:entity.accountName]) { if ([self isPureInt:entity.accountName]) {
[XBLoadingView showHUDViewWithText:@"银行卡号格式不正确"]; return; [XBLoadingView showHUDViewWithText:@"银行卡号格式不正确"]; return;
} }
#warning 待修改 if (![entity.phoneNumber isTelephone]) {
// if (![HENLENSONG isValidateMobile:entity.phoneNumber]) { [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"]; return;
// [XBLoadingView showHUDViewWithText:@"手机号码格式不正确"]; return; }
// }
NSString *type = [MyBankClass returnBankName:entity.bankAccount]; NSString *type = [MyBankClass returnBankName:entity.bankAccount];
WS(weakSelf); WS(weakSelf);
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import "MMDrawerController.h" #import "MMDrawerController.h"
#import "RightViewController.h" #import "RightViewController.h"
#import "IQKeyboardManager.h" #import "IQKeyboardManager.h"
#import "IQUIView+Hierarchy.h"
#import "AFNetworking.h" #import "AFNetworking.h"
#import "NetworkRequestClassManager.h" #import "NetworkRequestClassManager.h"
#import "ShoppingViewController.h" #import "ShoppingViewController.h"
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus]; PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];
if (status == PHAuthorizationStatusRestricted || if (status == PHAuthorizationStatusRestricted ||
status == PHAuthorizationStatusDenied) { status == PHAuthorizationStatusDenied) {
//无权限 ShowAlertView(@"提示", @"请在iPad的“设置-隐私-相册”选项中,允许欧立方访问你的相册", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
return NO; return NO;
} }
return YES; return YES;
...@@ -541,29 +541,6 @@ ...@@ -541,29 +541,6 @@
return NO; return NO;
} }
/**
选择框
@param message 文本
@param cancel 取消
@param sure 确认
*/
- (void)promptBoxWithMessage:(NSString *)message cancelBlock:(void(^)())cancel sureBlock:(void(^)())sure
{
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:message preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
if (cancel) {
cancel();
}
}]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
if (sure) {
sure();
}
}]];
[self presentViewController:alertVC animated:YES completion:nil];
}
/** /**
闯关结果状态 闯关结果状态
......
...@@ -62,7 +62,7 @@ PODS: ...@@ -62,7 +62,7 @@ PODS:
- WYPopoverController (0.3.9) - WYPopoverController (0.3.9)
- WZLBadge (1.2.6) - WZLBadge (1.2.6)
- YXAlertController (1.0.7) - YXAlertController (1.0.7)
- YXKit (0.0.1) - YXKit (0.0.2)
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 3.1.0) - AFNetworking (~> 3.1.0)
...@@ -88,7 +88,7 @@ DEPENDENCIES: ...@@ -88,7 +88,7 @@ DEPENDENCIES:
- WYPopoverController (~> 0.3.9) - WYPopoverController (~> 0.3.9)
- WZLBadge (~> 1.2.5) - WZLBadge (~> 1.2.5)
- YXAlertController (~> 1.0.7) - YXAlertController (~> 1.0.7)
- YXKit (~> 0.0.1) - YXKit (~> 0.0.2)
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
...@@ -116,8 +116,8 @@ SPEC CHECKSUMS: ...@@ -116,8 +116,8 @@ SPEC CHECKSUMS:
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4 WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 9ec779dcfd94c825518b395e8315fccaabff1bfa WZLBadge: 9ec779dcfd94c825518b395e8315fccaabff1bfa
YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b
YXKit: c43af7c4c72f5a3f4e6b59e4eca6946f1859f478 YXKit: 4869008392fd3ee0290ccc4dd657859b8a2e5939
PODFILE CHECKSUM: 663d88b7300774a48ecbbca414ddc8052abf95f2 PODFILE CHECKSUM: fba6b1ce033e4e3eb9e7890a823bc096661655fa
COCOAPODS: 1.2.1 COCOAPODS: 1.2.1
...@@ -62,7 +62,7 @@ PODS: ...@@ -62,7 +62,7 @@ PODS:
- WYPopoverController (0.3.9) - WYPopoverController (0.3.9)
- WZLBadge (1.2.6) - WZLBadge (1.2.6)
- YXAlertController (1.0.7) - YXAlertController (1.0.7)
- YXKit (0.0.1) - YXKit (0.0.2)
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 3.1.0) - AFNetworking (~> 3.1.0)
...@@ -88,7 +88,7 @@ DEPENDENCIES: ...@@ -88,7 +88,7 @@ DEPENDENCIES:
- WYPopoverController (~> 0.3.9) - WYPopoverController (~> 0.3.9)
- WZLBadge (~> 1.2.5) - WZLBadge (~> 1.2.5)
- YXAlertController (~> 1.0.7) - YXAlertController (~> 1.0.7)
- YXKit (~> 0.0.1) - YXKit (~> 0.0.2)
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
...@@ -116,8 +116,8 @@ SPEC CHECKSUMS: ...@@ -116,8 +116,8 @@ SPEC CHECKSUMS:
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4 WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 9ec779dcfd94c825518b395e8315fccaabff1bfa WZLBadge: 9ec779dcfd94c825518b395e8315fccaabff1bfa
YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b
YXKit: c43af7c4c72f5a3f4e6b59e4eca6946f1859f478 YXKit: 4869008392fd3ee0290ccc4dd657859b8a2e5939
PODFILE CHECKSUM: 663d88b7300774a48ecbbca414ddc8052abf95f2 PODFILE CHECKSUM: fba6b1ce033e4e3eb9e7890a823bc096661655fa
COCOAPODS: 1.2.1 COCOAPODS: 1.2.1
This diff is collapsed.
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.0.1</string> <string>0.0.2</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
![](https://img.shields.io/badge/language-OC/Swift-orange.svg) ![](https://img.shields.io/badge/language-OC/Swift-orange.svg)
![](https://img.shields.io/badge/QQ-1105938518-orange.svg) ![](https://img.shields.io/badge/QQ-1105938518-orange.svg)
pod 'YXKit', '~>1.0.0' pod 'YXKit', '~>0.0.1'
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
@interface NSString (Category) @interface NSString (Category)
/** /**
* 判断字符串是否为空 * 判断字符串是否为空
*/ */
...@@ -153,7 +154,10 @@ ...@@ -153,7 +154,10 @@
*/ */
- (NSString*)sha512; - (NSString*)sha512;
/**
格式化字符串
*/
- (NSString *)formatString;
@end @end
......
...@@ -514,4 +514,15 @@ ...@@ -514,4 +514,15 @@
} }
/**
去掉前后空格
*/
- (NSString *)formatString
{
NSCharacterSet *set = [NSCharacterSet whitespaceAndNewlineCharacterSet];
NSString *string = [self stringByTrimmingCharactersInSet:set];
return string;
}
@end @end
...@@ -26,6 +26,18 @@ ...@@ -26,6 +26,18 @@
//文字居中,图片在右边 //文字居中,图片在右边
- (void)horizontalCenterTitleAndImageRight:(CGFloat)spacing; - (void)horizontalCenterTitleAndImageRight:(CGFloat)spacing;
/**
* 倒计时按钮
*
* @param timeLine 倒计时总时间
* @param title 还没倒计时的title
* @param subTitle 倒计时中的子名字,如时、分
* @param mColor 还没倒计时的颜色
* @param color 倒计时中的颜色
*/
- (void)startWithTime:(NSInteger)timeLine title:(NSString *)title countDownTitle:(NSString *)subTitle mainColor:(UIColor *)mColor countColor:(UIColor *)color;
/** /**
快速创建按钮 快速创建按钮
......
...@@ -27,6 +27,41 @@ NSString const *UIButton_badgeValueKey = @"UIButton_badgeValueKey"; ...@@ -27,6 +27,41 @@ NSString const *UIButton_badgeValueKey = @"UIButton_badgeValueKey";
@implementation UIButton (Category) @implementation UIButton (Category)
- (void)startWithTime:(NSInteger)timeLine title:(NSString *)title countDownTitle:(NSString *)subTitle mainColor:(UIColor *)mColor countColor:(UIColor *)color {
__weak typeof(self) weakSelf = self;
//倒计时时间
__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(), ^{
weakSelf.backgroundColor = mColor;
[weakSelf setTitle:title forState:UIControlStateNormal];
weakSelf.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(), ^{
weakSelf.backgroundColor = color;
[weakSelf setTitle:[NSString stringWithFormat:@"%@%@",timeStr,subTitle] forState:UIControlStateNormal];
weakSelf.userInteractionEnabled = NO;
});
timeOut--;
}
});
dispatch_resume(_timer);
}
/** /**
快速创建按钮 快速创建按钮
*/ */
......
...@@ -27,6 +27,6 @@ target 'Lighting' do ...@@ -27,6 +27,6 @@ target 'Lighting' do
pod 'iCarousel', '~> 1.8.3' pod 'iCarousel', '~> 1.8.3'
pod 'UMengAnalytics' pod 'UMengAnalytics'
pod 'Bugly', '~> 2.4.7' pod 'Bugly', '~> 2.4.7'
pod 'YXKit, ~> 0.0.1 pod 'YXKit, ~> 0.0.2
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment