//
Created by mac on 16/12/23.
// Copyright © 2016年 zhangjian. All rights reserved.
//
// http://blog.sina.com.cn/resoftios
#import
@interface ZJProgressHUD : UIView
@property (nonatomic , copy) NSString *tipText;
@property (nonatomic , strong) UIColor *toastColor;
@property (nonatomic , strong) UIColor *contentColor;
@property (nonatomic , assign) BOOL showMask;
- (void)show:(BOOL)animated;
- (void)hide:(BOOL)animated;
+ (instancetype)showHUDto:(UIView *)view animated:(BOOL)animated;
+ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated;
// http://blog.sina.com.cn/resoftios
@end
// Created by mac on 16/12/23.
// Copyright © 2016年 zhangjian. All rights reserved.
//
#import "ZJProgressHUD.h"
#import
#define SIZE_RADIUS_WIDTH 12
#define SIZE_FONT_TIP 12
#define TIP_DEFULT_TEXT @"Loading..."
#define KEY_ANIMATION_ROTATE @"KEY_ANIMATION_ROTATE"
#define KEY_ANIMATION_TEXT @"KEY_ANIMATION_TEXT"
@interface ZJProgressHUD()
@property (nonatomic , strong) UIView *toast;
@property (nonatomic , strong) UIView *rotateView;
@property (nonatomic , strong) CAShapeLayer *rotateLayer;
@property (nonatomic , strong) CAShapeLayer *textLayer;
@end
@implementation ZJProgressHUD
+ (instancetype)showHUDto:(UIView *)view animated:(BOOL)animated
{
ZJProgressHUD *hud = [[self alloc] initWithView:view];
[view addSubview:hud];
[hud show:animated];
return hud;
}
+ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated
{
NSMutableArray *huds = [NSMutableArray array];
NSArray *subviews = view.subviews;
for (UIView *aView in subviews)
{
if ([aView isKindOfClass:[ZJProgressHUD class]])
{
[huds addObject:aView];
}
}
for (ZJProgressHUD *hud in huds)
{
[hud hide:animated];
}
return [huds count];
}
- (void)dealloc
{
}
static CGFloat toastWidth = 80;
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
self.tipText = TIP_DEFULT_TEXT;
_toast = [[UIView alloc] initWithFrame:CGRectMake((self.frame.size.width - toastWidth) / 2, (self.fram
//
//
// http://blog.sina.com.cn/resoftios
#import
@interface ZJProgressHUD : UIView
@property (nonatomic , copy) NSString *tipText;
@property (nonatomic , strong) UIColor *toastColor;
@property (nonatomic , strong) UIColor *contentColor;
@property (nonatomic , assign) BOOL showMask;
- (void)show:(BOOL)animated;
- (void)hide:(BOOL)animated;
+ (instancetype)showHUDto:(UIView *)view animated:(BOOL)animated;
+ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated;
// http://blog.sina.com.cn/resoftios
@end
//
//
//
#import "ZJProgressHUD.h"
#import
#define SIZE_RADIUS_WIDTH 12
#define SIZE_FONT_TIP 12
#define TIP_DEFULT_TEXT
#define KEY_ANIMATION_ROTATE @"KEY_ANIMATION_ROTATE"
#define KEY_ANIMATION_TEXT @"KEY_ANIMATION_TEXT"
@interface ZJProgressHUD()
@property (nonatomic , strong) UIView *toast;
@property (nonatomic , strong) UIView *rotateView;
@property (nonatomic , strong) CAShapeLayer *rotateLayer;
@property (nonatomic , strong) CAShapeLayer *textLayer;
@end
@implementation ZJProgressHUD
+ (instancetype)showHUDto:(UIView *)view animated:(BOOL)animated
{
}
+ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated
{
}
- (void)dealloc
{
}
static CGFloat toastWidth = 80;
- (instancetype)initWithFrame:(CGRect)frame
{