-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,58 @@ | ||
# TTAlert | ||
# TTAlert | ||
------ | ||
这是一个自定义AlertView遮罩层,返回用block. | ||
|
||
## 使用方法 | ||
` | ||
#import "TTAlert.h" | ||
@property (nonatomic, strong) TTAlert * alert; | ||
|
||
- (TTAlert *)alert{ | ||
if (!_alert) { | ||
_alert = [[TTAlert alloc] init]; | ||
} | ||
return _alert; | ||
} | ||
|
||
[self.alert show]; | ||
|
||
` | ||
## alert类型 | ||
` | ||
typedef NS_ENUM(int, TTAlertType) { | ||
TTAlertTypeNormal, // 提示类型(普通提示 normal)只有确定按钮 | ||
TTAlertTypeSuccessful, // 提示类型(成功提示 successful)只有确定按钮,顶部有✅对勾标志 | ||
TTAlertTypeDoubt // 提示类型(选择提示 doubt)有确定和取消按钮 | ||
}; | ||
` | ||
|
||
` | ||
/** 提示类型*/ | ||
@property (nonatomic) TTAlertType type; | ||
/**顶部图片*/ | ||
@property (nonatomic, strong) UIImage * icon; | ||
/**标题*/ | ||
@property (nonatomic, copy) NSString * titleText; | ||
/**标题Label*/ | ||
@property (nonatomic, strong) UILabel * titleTextLabel; | ||
/**内容*/ | ||
@property (nonatomic, copy) NSString * messageText; | ||
/**内容Label*/ | ||
@property (nonatomic, strong) UITextView * messageTextLabel; | ||
/**确认按钮*/ | ||
@property (nonatomic, strong) UIButton * confirmBtn; | ||
/**确认按钮文字*/ | ||
@property (nonatomic, copy) NSString * conformBtnTitle; | ||
/**取消按钮(默认不显示)*/ | ||
@property (nonatomic, strong) UIButton * cancelBtn; | ||
/**是否有取消按钮,默认“NO”*/ | ||
@property (nonatomic) BOOL haveCancelBtn; | ||
// 显示 | ||
- (void)show; | ||
// 消失 | ||
- (void)dismiss; | ||
|
||
-(void)didConfirm:(void (^)(UIButton * button))didConfirm; //点击确定时返回的block | ||
-(void)didCancel:(void (^)(UIButton * button))didCancel; //点击取消时(如果有取消按钮)返回的block | ||
-(void)didDisappear:(void (^)(UIButton * button))didDisappear; //alert消失时返回的block | ||
` |