【代码笔记】iOS-MBProgressHUD-Demo

一,工程图。

【代码笔记】iOS-MBProgressHUD-Demo

二,代码。

ViewController.m

【代码笔记】iOS-MBProgressHUD-Demo
#import "ViewController.h"
#import "MBProgressHUD.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    //初始化MBProgressHUD
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.mode = MBProgressHUDModeCustomView;
    hud.labelText = @"加载中";
    
    
}
//点击任何处隐藏MBProgressHUD
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
【代码笔记】iOS-MBProgressHUD-Demo

相关推荐