AlertHandler.h
1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// AlertHandler.h
// mkh_ios
// 踢实框处理类
// Created by 钱鋆 on 15/6/30.
// Copyright (c) 2015年 mkh.cn. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface AlertHandler : NSObject
#pragma mark 创建单例
/**
* @author qianjun
*
* @brief 创建单例
*
* @return self
*/
+ (instancetype)sharedInstance;
#pragma mark -ios默认的alert
-(void)showAlert_default_title:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle tag:(NSInteger)tag;
- (void)f_showAlert_default_title:(NSString *)title message:(NSString *)message confirmHandler:(void (^)(UIAlertAction *action))confirmHandler confirmTitle:(NSString *)confirmTitle target:(UIViewController *)target;
- (void)f_showAlert_default_title:(NSString *)title message:(NSString *)message confirmHandler:(void (^)(UIAlertAction *action))confirmHandler confirmTitle:(NSString *)confirmTitle cancelHandler:(void (^)(UIAlertAction *action))cancelHandler cancelTitle:(NSString *)cancelTitle target:(UIViewController *)target;
#pragma mark -ios默认的confirm
-(void)showConfirm_default_title:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitle:(NSString *)otherButtonTitle tag:(NSInteger)tag;
#pragma mark - 定义类似于toast显示效果的HUD(每次临时生成,效果结束后立即remove)
-(void)showToastHUD:(UIView *)addView message:(NSString *)message sleepTime:(int)sleepTime;
#pragma mark - 自定义画面(每次临时生成,效果结束后立即remove)
-(void)showCustomHUD:(UIView *)addView Image:(NSString *)image message:(NSString *)message sleepTime:(int)sleepTime;
#define AlertMessage(__title__, __message__) [[[UIAlertView alloc] initWithTitle:__title__ \
message:__message__ \
delegate:nil \
cancelButtonTitle:@"确定" \
otherButtonTitles:nil] show]
@end