码迷,mamicode.com
首页 > 其他好文 > 详细

MBProgressHUD长时间加载无法取消的解决方法

时间:2015-08-04 19:03:14      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

使用MBProgressHUD时,加载网路数据,或者等待webview加载完毕,长时间的等待导致体验不佳,这时候希望点击屏幕取消加载动画效果;

//  MBProgressHUD.h

@protocol MBProgressHUDDelegate <NSObject>

@optional

/** 
 * Called after the HUD was fully hidden from the screen. 
 */
- (void)hudWasHidden:(MBProgressHUD *)hud;

-(void)hudViewTapGesture;

@end



//  MBProgressHUD.m

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    if ([self.delegate respondsToSelector:@selector(hudViewTapGesture)]) {
        [self.delegate performSelector:@selector(hudViewTapGesture)];
    }
}


//viewcontroller.m

-(void)hudViewWasTapped {
    [HUD hide:YES];
}

 

MBProgressHUD长时间加载无法取消的解决方法

标签:

原文地址:http://www.cnblogs.com/mangoes/p/4702644.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!