-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMUActionSheet.h
executable file
·71 lines (63 loc) · 2.28 KB
/
MUActionSheet.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#import <UIKit/UIKit.h>
@class MUActionSheet;
/**
* block回调
*
* @param actionSheet LPActionSheet对象自身
* @param index 被点击按钮标识,取消: 0, 删除: -1, 其他: 1.2.3...
*/
typedef void(^MUActionSheetBlock)(MUActionSheet *actionSheet, NSInteger index);
@interface MUActionSheet : UIView
/**
* 创建MUActionSheet对象
*
* @param title 提示文本
* @param cancelButtonTitle 取消按钮文本
* @param destructiveButtonTitle 删除按钮文本
* @param otherButtonTitles 其他按钮文本
* @param actionSheetBlock block回调
*
* @return MUActionSheet对象
*/
- (instancetype)initWithTitle:(NSString *)title
cancelButtonTitle:(NSString *)cancelButtonTitle
destructiveButtonTitle:(NSString *)destructiveButtonTitle
otherButtonTitles:(NSArray *)otherButtonTitles
handler:(MUActionSheetBlock)actionSheetBlock NS_DESIGNATED_INITIALIZER;
/**
* 创建MUActionSheet对象(便利构造器)
*
* @param title 提示文本
* @param cancelButtonTitle 取消按钮文本
* @param destructiveButtonTitle 删除按钮文本
* @param otherButtonTitles 其他按钮文本
* @param actionSheetBlock block回调
*
* @return MUActionSheet对象
*/
+ (instancetype)actionSheetWithTitle:(NSString *)title
cancelButtonTitle:(NSString *)cancelButtonTitle
destructiveButtonTitle:(NSString *)destructiveButtonTitle
otherButtonTitles:(NSArray *)otherButtonTitles
handler:(MUActionSheetBlock)actionSheetBlock;
/**
* 弹出MUActionSheet视图
*
* @param title 提示文本
* @param cancelButtonTitle 取消按钮文本
* @param destructiveButtonTitle 删除按钮文本
* @param otherButtonTitles 其他按钮文本
* @param actionSheetBlock block回调
*
*
*/
+ (void)showActionSheetWithTitle:(NSString *)title
cancelButtonTitle:(NSString *)cancelButtonTitle
destructiveButtonTitle:(NSString *)destructiveButtonTitle
otherButtonTitles:(NSArray *)otherButtonTitles
handler:(MUActionSheetBlock)actionSheetBlock;
/**
* 弹出视图
*/
- (void)show;
@end