Last active
December 15, 2015 05:59
-
-
Save monjer/5212668 to your computer and use it in GitHub Desktop.
加UIAlertView的网络提示分类
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIAlertView+Loading.h | |
| // | |
| // Created by manjun.han on 13-3-21. | |
| // Copyright (c) 2013年 mj. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> | |
| @interface UIAlertView (Loading) | |
| + (UIAlertView*)showWaitIndicator:(NSString *)title ; | |
| + (UIAlertView*)showAlert:(NSString *)title message:(NSString *)message ; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIAlertView+Loading.m | |
| // | |
| // Created by manjun.han on 13-3-21. | |
| // Copyright (c) 2013年 mj. All rights reserved. | |
| // | |
| #import "UIAlertView+Loading.h" | |
| @implementation UIAlertView (Loading) | |
| // 显示加载进度提示 | |
| + (UIAlertView*)showWaitIndicator:(NSString *)title | |
| { | |
| UIAlertView *progressAlert; | |
| progressAlert = [[UIAlertView alloc] initWithTitle:title | |
| message:@"Please wait..." | |
| delegate:nil | |
| cancelButtonTitle:nil | |
| otherButtonTitles:nil]; | |
| [progressAlert show]; | |
| UIActivityIndicatorView *activityView; | |
| activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; | |
| CGFloat x = progressAlert.bounds.size.width/2.0 ; | |
| CGFloat y = progressAlert.bounds.size.height - 45 ; | |
| activityView.center = CGPointMake(x, y) ; | |
| [progressAlert addSubview:activityView]; | |
| [activityView startAnimating]; | |
| return progressAlert; | |
| } | |
| // 显示提示信息快捷方法 | |
| + (UIAlertView*)showAlert:(NSString *)title message:(NSString *)message | |
| { | |
| UIAlertView *alert = [[UIAlertView alloc] initWithTitle: title | |
| message: message | |
| delegate: nil | |
| cancelButtonTitle: @"OK" | |
| otherButtonTitles: nil]; | |
| [alert show]; | |
| return alert ; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment