添加弹窗
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
//
|
||||
|
||||
#import "KBSearchSectionHeader.h"
|
||||
#import "KBAlert.h"
|
||||
|
||||
@interface KBSearchSectionHeader ()
|
||||
@property (nonatomic, strong, readwrite) UILabel *titleLabel;
|
||||
@@ -15,6 +16,8 @@
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self setupUI];
|
||||
_confirmColor = [UIColor redColor];
|
||||
_cancelColor = [UIColor blackColor];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -39,7 +42,19 @@
|
||||
}
|
||||
|
||||
- (void)tapTrash {
|
||||
if (self.onTapTrash) { self.onTapTrash(); }
|
||||
// 弹出确认框:是否删除所有历史记录
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[KBAlert confirmTitle:@"清空历史"
|
||||
message:@"是否删除所有历史记录?"
|
||||
ok:@"确定"
|
||||
cancel:@"取消"
|
||||
okColor:weakSelf.confirmColor
|
||||
cancelColor:weakSelf.cancelColor
|
||||
completion:^(BOOL ok) {
|
||||
if (ok && weakSelf.onTapTrash) {
|
||||
weakSelf.onTapTrash();
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)configWithTitle:(NSString *)title showTrash:(BOOL)showTrash {
|
||||
@@ -69,4 +84,3 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user