// // TLSHUDHelper.m // tls // // Created by pican zhang on 2016/12/15. // Copyright © 2016年 tianlishe. All rights reserved. // #import "ZCHUDHelper.h" @implementation ZCHUDHelper + (void)showImage:(UIImage*)image title:(NSString*)title showtime:(CGFloat)showtime{ [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom]; [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone]; [SVProgressHUD setBackgroundColor:DecColorFromRGBA(0, 0, 0, 0.8)]; [SVProgressHUD setForegroundColor:HexColorFromRGB(0xffb64b)]; [SVProgressHUD setFont:[UIFont boldSystemFontOfSize:18]]; [SVProgressHUD setCornerRadius:4.0]; [SVProgressHUD setMinimumSize:CGSizeMake(1, 1)]; [SVProgressHUD setSuccessImage:image]; [SVProgressHUD showSuccessWithStatus:[NSString stringWithFormat:@"%@",title]]; if (showtime !=0) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(showtime * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [SVProgressHUD dismiss]; }); } } + (void)showTitle:(NSString*)title{ [self showTitle:title showtime:3.0]; } + (void)showTitle:(NSString*)title showtime:(CGFloat)showtime{ [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom]; [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone]; [SVProgressHUD setBackgroundColor:DecColorFromRGBA(0, 0, 0, 0.7)]; [SVProgressHUD setForegroundColor:[UIColor whiteColor]]; [SVProgressHUD setFont:[UIFont boldSystemFontOfSize:14]]; [SVProgressHUD setCornerRadius:4.0]; [SVProgressHUD setMinimumSize:CGSizeMake(1, 1)]; [SVProgressHUD setSuccessImage:nil]; [SVProgressHUD showSuccessWithStatus:[NSString stringWithFormat:@"%@",title]]; if (showtime !=0) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(showtime * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [SVProgressHUD dismiss]; }); } } + (void)show{ [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom]; [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear]; [SVProgressHUD setBackgroundColor:DecColorFromRGBA(0, 0, 0, 0.7)]; [SVProgressHUD setForegroundColor:[UIColor whiteColor]]; [SVProgressHUD show]; } + (void)showWithStatus:(NSString*)status{ [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom]; [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear]; [SVProgressHUD setBackgroundColor:DecColorFromRGBA(0, 0, 0, 0.7)]; [SVProgressHUD setForegroundColor:[UIColor whiteColor]]; [SVProgressHUD showWithStatus:status]; } + (void)dismiss{ [SVProgressHUD dismiss]; } @end