42 lines
1.2 KiB
Objective-C
42 lines
1.2 KiB
Objective-C
|
|
|
|
// Created by lee on 2019/5/23.
|
|
|
|
|
|
#import "TTActionSheetConfig.h"
|
|
#import "DJDKMIMOMColor.h"
|
|
|
|
@implementation TTActionSheetConfig
|
|
|
|
|
|
+ (TTActionSheetConfig *)normalTitle:(NSString *)title clickAction:(TTActionSheetClickAction)clickAction {
|
|
|
|
return [self normalTitle:title selectColorType:TTItemSelectNormal clickAction:clickAction];
|
|
}
|
|
|
|
+ (TTActionSheetConfig *)normalTitle:(NSString *)title selectColorType:(TTItemSelectType)type clickAction:(TTActionSheetClickAction)clickAction {
|
|
|
|
UIColor *color = type == TTItemSelectHighLight ? [DJDKMIMOMColor alertTitleColor] : [DJDKMIMOMColor alertTitleColor];
|
|
|
|
TTActionSheetConfig *config = [self actionWithTitle:title color:color handler:clickAction];
|
|
config.type = type;
|
|
|
|
return config;
|
|
}
|
|
|
|
+ (TTActionSheetConfig *)actionWithTitle:(NSString *)title
|
|
color:(UIColor *)textColor
|
|
handler:(TTActionSheetClickAction)handler {
|
|
|
|
TTActionSheetConfig *config = [[TTActionSheetConfig alloc] init];
|
|
config.type = TTItemSelectNormal;
|
|
config.title = title;
|
|
config.titleColor = textColor;
|
|
config.clickAction = handler;
|
|
|
|
return config;
|
|
}
|
|
|
|
|
|
@end
|