|
@@ -25,9 +25,11 @@
|
|
|
|
|
|
@property (nonatomic, assign) NSInteger maxInputCount;
|
|
|
|
|
|
+@property (nonatomic, assign) BOOL needEmptyTips;
|
|
|
@end
|
|
|
|
|
|
@implementation CourseGroupPlanAlertView
|
|
|
+
|
|
|
- (void)awakeFromNib {
|
|
|
[super awakeFromNib];
|
|
|
self.textView.delegate = self;
|
|
@@ -97,6 +99,10 @@
|
|
|
|
|
|
- (IBAction)sureAction:(id)sender {
|
|
|
[self endEditing:YES];
|
|
|
+ if (self.needEmptyTips && [NSString isEmptyString:self.textView.text]) {
|
|
|
+ [LOADING_MANAGER MBShowAUTOHidingInWindow:self.tipsLabel.text];
|
|
|
+ return;
|
|
|
+ }
|
|
|
[self removeFromSuperview];
|
|
|
if (self.callback) {
|
|
|
self.callback(self.textView.text);
|
|
@@ -105,6 +111,8 @@
|
|
|
|
|
|
// 暴露给其他地方使用
|
|
|
- (void)configWithHeadTitle:(NSString *)headTitle tipsDesc:(NSString *)tipsDesc sureButtonTitle:(NSString *)sureButtonTitle maxCount:(NSInteger)maxCount {
|
|
|
+ self.needEmptyTips = YES;
|
|
|
+ self.maxInputCount = maxCount;
|
|
|
self.headTitleLabel.text = [NSString returnNoNullStringWithString:headTitle];
|
|
|
self.tipsLabel.text = [NSString returnNoNullStringWithString:tipsDesc];
|
|
|
[self.sureButton setTitle:sureButtonTitle forState:UIControlStateNormal];
|